Ad
  • Custom User Avatar

    Hello! yours is top voted so i wanted to ask you and everyone else, is there a better way to do this than to use .combination(k)? If i'm not not mistaken this method creates every single combination, as opposed to doing something like making every combination in order until it creates an array with a sum that is over the target distance and then stopping. I ended up using combination as well, but isn't the time efficiency of it pretty bad? Your solution is super elegant, just want to understand if there's more efficient ways.

  • Custom User Avatar

    you're kidding me.
    edit: this is beautiful btw.

  • Custom User Avatar