Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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
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.
So, are you saying that your solution is better in regards to time space complexity?
:)
damn that bouncing off solution though
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.
*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
This comment is hidden because it contains spoiler information about the solution
Because they're the only ones which their square contain the digit 1.
can someone please explain why it is 14,19 then 21 for the (25,1) example? thank you
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.
x + 0 == x
0 does not add up in summation which is
Oh yes, it will
wont work if 0 is missing
Loading more items...