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.
Should be a 6 kyu problem in c
Your code doesn't return -1 when bounce is 1
If bounce is 1 and h is greater than window, it will always be greater than window so the loop runs forever.
Nice but it can be solved in O(n) time though. qsort would take O(nlogn) time.
Doesn't this take O(n^2) time though?
Not efficient enough. There's a famous math algorithm to find the greatest common divisor
Simple as