Number base:
Your code works well and passes all the tests, but it is hard to read, if you add comments where you use complex, it makes it easier to read and follow for others and later for you to understand what you did.
For example this line:
Also, instead of mapping all letters to numbers you could have used ord() function.
Binary search:
The iterative solution is working. but the recursive binary search is failing and throwing RecursionError: maximum recursion depth exceeded in comparison this is because you are not checking your bounds. add this line somewhere at the beginning of the recursive binary search.
Also, instead of mapping all letters to numbers you could have used
ord()
function.RecursionError: maximum recursion depth exceeded in comparison
this is because you are not checking your bounds. add this line somewhere at the beginning of the recursive binary search.this stops the infinite recursive call.