You are here: Home → Forums → Ruby → How to parse "42, 6" into Ruby variables?
Add a reply
A 29degrees diversion |
I have 39 byte solution in Ruby (best is 36), and 39 byte solution in Python (best is 39), using identical algorithm.
Breakdown for Ruby:
* input - 17
* algorithm - 20
* output - 2
Breakdown for Python:
* input - 12
* algorithm - 22
* output - 5
So either it's possible to save 3 more bytes in Ruby algorithm, but not in Python (what doesn't seem very likely), or I'm parsing input inefficiently.
What's the best way to parse such input - any hints?