Ad
  • Custom User Avatar

    It feels like cheating 😂

  • Custom User Avatar

    What's the time complexity of this solution?

  • Custom User Avatar

    Which part of "There's binary search solution" did you just miss? :P

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    If you solve it with algorithm this is a binary search problem with O(log n) solution. Considering sum of cubes must not exceed unsigned 64 bit integer, answer is found in 17 steps at worst case.

    This answer is O(n) solution. Worst case scenario is at roughly 92682 steps. Are you calling it clever?

  • Custom User Avatar

    Morse code table as JSON

    {"-.-.-.":";","-...-":"=","---":"O","----.":"9","-..-.":"/",".-...":"&","...--":"3",".--":"W","--":"M","--..":"Z",".----.":"'","-.-.--":"!","-...":"B","..-":"U",".----":"1","-.--.-":")",".-":"A","-....-":"-","...-":"V","...---...":"SOS","-.--":"Y","..":"I","--.-":"Q","-.":"N","..---":"2","-....":"6","---...":",",".-.-.":"+",".--.-.":"@","....-":"4","-----":"0",".-.-.-":".","-.-.":"C",".":"E","..-.":"F",".---":"J","-.-":"K",".-..":"L",".-.":"R","...":"S","--.":"G","---..":"8","..--..":"?","-.--.":"(",".--.":"P",".....":"5","..--.-":"_","-..":"D",".-..-.":"\"","-":"T","....":"H","--..--":",","...-..-":"$","--...":"7","-..-":"X"}
    
  • Custom User Avatar

    Why do people keep upvoting inefficient implementations as best practice and clever?

  • Custom User Avatar

    Yeah that's bothering me too. O(n) solutions are not that longer than these O(n^2) solutions.