(a)
| 5 | |
| 6 | |
| 7 | def lis(a): |
| 8 | n = len(a) |
| 9 | # initialize ans array same lenth as 1 |
| 10 | ans = [1] * n |
| 11 | for i in range(1, n): |
| 12 | # now compare with first index to that index |
| 13 | for j in range(i): |
| 14 | if a[i] > a[j] and ans[i] < ans[j] + 1: |
| 15 | ans[i] = ans[j] + 1 |
| 16 | return max(ans) |
| 17 | |
| 18 | |
| 19 | a = [1, 3, 2, 6, 4] |
no outgoing calls
no test coverage detected