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.
Something's fucky!
in my opinion, this is EXACTLY how not to join lists. and i explain why.
first, if you live in real world, you can come up to really huge lists, which gives you opportunity to hit stack overflow...
so, i would just travere (loop) the list A, find end, and assign that end to list B
OR
i would just assign each node of List B, to List A, similair like this, but in traverse way (with loop), not reccursevlly...
in languages like c++, the first option would be much nicer, cause you can just reassing node pointers, and find an end amazingly FAST.
No need to reassign each node which cost in performance heavily.. just connect two worms together...
Benchmarked on modern .NET using BenchmarkDotNet.
Min() + Max()from LINQ turned out to be faster than a manualforloop in my tests.LINQ/BCL methods are heavily optimized nowadays.
table { border-collapse: collapse; display: block; width: 100%; overflow: auto; } td, th { padding: 6px 13px; border: 1px solid #ddd; text-align: right; } tr { background-color: #fff; border-top: 1px solid #ccc; } tr:nth-child(even) { background: #f8f8f8; }Always benchmark instead of relying on intuition.
It's literally part of the instructions that the input string contains only letters.
wow!
the one liner wizard. Not a pro enough to start doing 1 liner xD
Get ahead with the times, people! /j
This is really cool,but I'll learn it later when I become an expert!
i have no idiea ,absolute code
Same bro
These qs are supposed to be debugged not optimized
writing it in 1 line doesn't make it better...
Super clever!
Contrary to other posters, I believe this is best practice and best performance. the Min Max implementations are vectorized, making them faster than the typical for loop by an order of magnitude. Even considering the double iteration. this will depend on the hardware.
@hiyosilver - did you benchmark your code? I did, and the "naive" Min/Max solution is indeed faster. C# vectorizes the search, which makes it an order of magnitude faster than a linear search with a for loop, according to my benchmark.
Loading more items...