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.
can you just explain me what line 6 do ? I'm confused
The std::exchange + ternary made it perfect. Nice work!
Great stuff, love it! Contains some nice hidden details such as using
operator<
onstd::pair<>
, C++14 lambda captures with initializer, etc. that make the solution very dense.Greatest drawback, in my opinion, is that it doesn't work for empty lists of intervals where it does invoke UB (because of
intervals[0]
). I fixed that in a fork, and additionally improved readability a bit more by using some other modern C++ features.Condensed, yes. But also not easy on the eyes :)
Amazing! Took me 107 lines of code *laughing emoji