Closed IlyaUmanets closed 6 years ago
Looks nice to me!
It may be worth creating a new example line with .join.to_i
at the end (awesome_number.to_s.chars.map(&:to_i).reverse.join.to_i
) just so digits are reversed and an actual number is returned. What do you think?
@MarcosX, I'm not sure that it's a good idea, the main purpose of this trick is to get a digits from a number, no need to join
them and return as a reversed number.
Thank you for your comment !
Ah ok, the reverse
was just an example. Awesome.
Sorry, clicked in the wrong button. I'm okay with this changes, let's see what other have to say.
@MarcosX, Can you merge this PR ?
Changes: