Ad
  • Custom User Avatar

    Seriously. The top 2 solutions above of this one is either 1) not readable or 2) not extensible.

  • Custom User Avatar

    I think it's too easy if you allow the usage of .sort

  • Custom User Avatar

    I would refrain from using single letter variables. It looks badass on paper, but if another programmer comes without knowing what the function is intended to do, he's going to want to murder you. Instead of writing "d" and "i", you should write out what they are. d => number, i => index. I know the kata gives you n and p, but code quality drops dramatically if you follow their naming of variable and try to look l33t with those single letter variables.