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.
OP solved it, closing
is my code (:
Epic Shit dude, mean while I tried to create a for loop and iterate the list I was looping and used .sort and created a whole sorting function πππ
good code)
This is realy good
Thank you
It is explained in the description. The second element of
[3, 7]
pair comes before the second element of[5, 5]
pair, hence that should be the result.sum_pairs([10, 5, 2, 3, 7, 5], 10)
why [3,7] why not [5,5]
Please help me to understand the logic
Next time you can use Markdown formatting to format it: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code
Something in the "Excruciatingly Long List Tests" is timing out for you :D
BTW:
This looks like O(n^3) (I'm not good at time complexity, so that's probably a bit inaccurate), But I see an O(n) solution is possible (I think that's O(n), where n = len(ints)). Try another way of doing it.
This comment is hidden because it contains spoiler information about the solution
God, that's so funny
this one kicked my beginner ass.
btw it never gets old when i finish one of these in 2 hours with a 50-line solution, and i go check the top answers and some swedish dude solved it with 1 line of code. FeelsBadMan
Thank you, I got it working.
ok, that's actually it, but because of sort of an "edge case". Print stuff inside your loop, so that you'll hit the buffer limit before anything else (print enough, tho), that should allow you to track what you forgot.
that means you're storing too much data in memory. You need to change your approach a bit to make it "memory wise"wait, forget that. I forgot you needed to return the complete sequence. No idea for now.
Loading more items...