Well, I think when we need just the two minimum items in the list, there is not optimal to sort all the list and then just pick two of them. ---> O(n^2) >> O (2n)
How is telling you which data structure to use a spoiler?
Well, if I tell you about the streamlined algorithm, then that is a spoiler. There is a loop within loop way, and there is a way to do this with one loop.
Please use new python test framework.
Looks like u solved it
Looks like u solved it
looks like u alr solved it
Sure, it is, I just mean that to find the first two min of the list, (2n) in enough instead of (n^2) or (n log n)
There is no such thing as O(2n). The 2 drops out since it's a constant, so it's actually O(n).
Yes, if they are implemented in quick-sort or heap-sort or... .Also O(n log n) > O(2n)
sorting is
O(n log n)
, notO(n²)
(out of special considerations, and assuming you're using a builtin to do it)Well, I think when we need just the two minimum items in the list, there is not optimal to sort all the list and then just pick two of them. ---> O(n^2) >> O (2n)
How is telling you which data structure to use a spoiler?
Well, if I tell you about the streamlined algorithm, then that is a spoiler. There is a loop within loop way, and there is a way to do this with one loop.
what is a streamlined algorithm?
You should have marked your comment as spoiler.
This comment is hidden because it contains spoiler information about the solution
As far as I can see, it's shown in the description.
Hi all
where can I find the Fighter class at codewars?
i have solved this task on Intellij without any problems but not here on codewars.
Loading more items...