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.
looks like u solved it
Firstly, please use the
spoiler
flag when you post code in the discourse, even if your solution is wrong.As for your code: are you supposed to return
-1
ifa
is less thanb
or is there another condition that needs to be checked first? If I run your code with the following[a,b]
values, it will always return -1, regardless of any margin:[1,2], [1,100], [5,6], [5,7], [5,8]
. Can you see why?