Ad
  • Default User Avatar

    It feels like cheating 😂

  • Default User Avatar

    What's the time complexity of this solution?

  • Default User Avatar

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

  • Default User Avatar

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

  • Default 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?

  • Default 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"}
    
  • Default User Avatar

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

  • Default User Avatar

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