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

Commit74c601d

Browse files
author
calypso
authored
Merge pull request#19 from leovano/leovano-021-ruby
02/1 - Ruby [UPDATE]
2 parents7858199 +3585bac commit74c601d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
word.chars.group_by(&:itself).transform_values(&:size).invert
66
end
77

8-
chars_two=counts.select{ |c|c[2]}.size
9-
chars_three=counts.select{ |c|c[3]}.size
8+
chars_two=counts.count{ |c|c[2]}
9+
chars_three=counts.count{ |c|c[3]}
1010

1111
putschars_two *chars_three
1212
rescueTypeError

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp