Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb46a630

Browse files
author
calypso
authored
Merge pull request#14 from leovano/leovano-021-ruby
02/1 - Ruby
2 parentsc2e855f +bb90b72 commitb46a630

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎2018/02_1/ruby/leovano.rb‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
begin
4+
counts=File.readlines(ARGV[0]).mapdo |word|
5+
word.chars.group_by(&:itself).transform_values(&:size).invert
6+
end
7+
8+
chars_two=counts.select{ |c|c[2]}.size
9+
chars_three=counts.select{ |c|c[3]}.size
10+
11+
putschars_two *chars_three
12+
rescueTypeError
13+
STDERR.puts'Arg1'
14+
rescueStandardError=>e
15+
STDERR.putse
16+
end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp