Consider the following binary search code in Python :
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
It works perfectly, unless if you forgot to sort in the first place! Given that is a permutation of 0 to 6 and is an integer in , how many distinct inputs are there such that the code still works?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.