:type nums: List[int] :rtype: int
(self, strings)
| 34 | |
| 35 | class Solution(object): |
| 36 | def lengthOfLIS(self, strings): |
| 37 | """ |
| 38 | :type nums: List[int] |
| 39 | :rtype: int |
| 40 | """ |
| 41 | if not strings: |
| 42 | return 0 |
| 43 | long_ss = [] |
| 44 | |
| 45 | for i in strings: |
| 46 | if not long_ss: |
| 47 | long_ss.append(([i], 1)) |
| 48 | continue |
| 49 | maxs = max(long_ss, key=lambda x: x[0][-1] < i and x[1]+1) |
| 50 | if maxs[0][-1] >= i: |
| 51 | long_ss.append(([i], 1)) |
| 52 | else: |
| 53 | long_ss.append((maxs[0]+[i], maxs[1]+1)) |
| 54 | |
| 55 | return max(long_ss, key=lambda x: x[1])[1] |
nothing calls this directly
no outgoing calls
no test coverage detected