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.
Technically, his solution is more optimal than the other solutions given. If you use
qsort
(O(n2 log n2)
on the avg. case) onarr2
, andbsort
onarr2
for every element inarr1
((O(n1 log n2)
), then you have a time complexity ofO((n1 + n2) * log(n2))
, while the complexity of the other solutions areO(n1 * n2)
.