I'm trying to implement a program for Longest Increasing Subsequence, It's giving correct output for some input patterns, But for some it's giving incorrect result. Can anybody tell me where is the bug in the code.
Here's my code
Code:
def binary_search(t, l, r, key):
while (r - l > 1):
m = l + (r - l)//2
if (t[m]>=key):