New answers tagged ruby
2
votes
Solution to Codejam 2022 1C (Letter Blocks) in Ruby
The valid_tower? predicate is very nice.
tiny nit:
sorted_tower.squeeze!
tower.squeeze.size == sorted_tower.size
Go for ...
- 7,066
1
vote
Solution to a competive programming contest (Codejam 2011 1A)
I'm just going to comment on one function for now, since it's what I have time for.
This is a "C in ruby" style approach rather than idiomatic ruby:
...
- 4,270
1
vote
Solution to a competive programming contest (Codejam 2011 1A)
I am reading main.
I like it.
I was going to grumble about "identifiers are too terse,
use the same business terms found in the spec."
But then I read the ...
- 7,066
2
votes
Parse a document and returning uniqueness and total number occurrences
How can I make this code better?
By making it simpler and shorter. The current solution creates many unnecessary abstractions.
Idiomatic ruby should embrace the built-in methods of ...
- 4,270
Top 50 recent answers are included
Related Tags
ruby × 1620ruby-on-rails × 561
beginner × 165
performance × 104
object-oriented × 86
algorithm × 84
active-record × 82
programming-challenge × 76
rspec × 65
strings × 57
array × 52
unit-testing × 43
datetime × 41
game × 36
parsing × 30
regex × 30
controller × 30
validation × 29
time-limit-exceeded × 25
api × 24
comparative-review × 23
hash-map × 23
sorting × 22
formatting × 21
tic-tac-toe × 19