Ad
  • Default User Avatar

    you're 4 kyu so a 30 minute problem can either be 5kyu or 6 kyu easily so it's not outrageous. And if it's not outrageous no need to cherry pick

  • Default User Avatar

    Heap is really not good solution in this situation. it does not help the algorithm become all that much more efficient. Using a heap instead would barely show significant gain in performance, bar certain very narrow situations. Using heap here to reduce from O(2n) to O(n), while using a loop is already so elegant and simply, is impractical (in most cases), in short.

    That being said, while this solution is elegant, some understanding of time and space complexity is required for beginners to make the most of it. Blindly following code shortening practices is not good software engineering practice.

  • Default User Avatar

    damn that bouncing off solution though

  • Default User Avatar

    guys look PLEASE... this solution is straight up NON-PRACTICAL in the context of real programming... Readability is ALWAYS secondary to such a order of magnitude difference in speed... in the context of "real" programming there is no question of it... the difference between O(n) and O(n**2) is as stark as taking your money and literally burn it or invest it smartly... Please if you're a newbie and don't know whats going on, learn about time and space complexity asap. I made the same mistake earlier for sure but learning some of the basics totally changed how i look at coding.

  • Default User Avatar

    *bad practice not best practice. this is n**2 O(n). People who dont know time space complexity should go on youtube and learn the basics

  • Default User Avatar

    can someone please explain why it is 14,19 then 21 for the (25,1) example? thank you

  • Default User Avatar

    my friend you're far removed from reality. those who dont do mathematics, such as me, don't have a clue what the formula means.

  • Default User Avatar
  • Default User Avatar

    you 1 dan and 1 kyu people should really so easier with your ranking from now on. This is definitely a 4 kyu. The sudoku checking one is 4 kyu and as you can imagine is way easier than this to figure out lol.

  • Default User Avatar

    no problem helping each other is always a good thing!

  • Default User Avatar

    nah dude i think this is a great solution in terms of how codewar-ic it is. not best practice, but very clever for sure.

  • Default User Avatar

    I am also still new to codewars and have a lot to learn. IMO this is a rather inefficient and adding too many if statements to satisfy all the datapoints is generally a bad idea. You should look into improving your problem solving skills with dict/hash map and creating new data objects(list, dict, array, etc) to solve problems. just search for the katas by keyword. Programming is all about improving yourself and learn new stuff so dont stress yourself and just take your time!

  • Default User Avatar

    Well there's the 5 kyu in which you have to reverse the string according to the nested level of the parantheses...

  • Default User Avatar