Ad
  • Custom User Avatar

    'Best Practices' and 'Clever' are nice ways to flag a solution but there should be a 'Bad Practice' flag too.
    So many bad solutions (unreadble but short) get 'Best practice' flags and it's very missleading to anyone trying to learn from other peoples code. Negative flags would help counter this problem but might need a trial just incase we're all secretly trolls.

  • Custom User Avatar

    I think this is too easy for a 4 kyu can it be made a 5 kyu?

  • Custom User Avatar

    I like how you overwrite node.next attribute while looping. +1 Clever.

  • Custom User Avatar

    I think this is a bit easy for a 6 Kyu.

  • Custom User Avatar

    Nice use of formatting and each_with_object. +1 Best Practice.

  • Custom User Avatar

    You are totally correct, This is not best practice at all! If someone put this in production code I would have them fired unless they refectored it immediately.

  • Custom User Avatar

    This is nice short code but it's not performant. The spec said clearly that the number could be as long as 1000 characters so this code is highly inefficient.

    Using just a 145 char input:
    '8796124949812349867123476123861036743081267246891823601824612380182479182370641298367104287614391340128437678236298348731048461735109841091212442'

    This solution solves it in 223.375ms, whereas my solution took only 24.632ms. Mine is far from perfect but it shows how much of a difference the performance makes. People should try to remember that this isn't code golf, we should aim for production ready code and maybe even include a benchmark in the spec!

  • Custom User Avatar

    In any base 0 is 0, and if im not mistaken that's a palidrome. Since programmers tend to count from 0 I think it should be included in the output and tests. It was confusing to have to explicitly exclude it.

  • Custom User Avatar

    Just in case you don't know, you realy shouldn't be nesting ternary operators within each other. It's not best practice and this isn't code golf ;)