```
public class Solution {
public int lengthOfLIS(int[] nums) {
if (null == nums || nums.length == 0) {
return 0;
}
int max = 1;
for (int i = 0; i < nums.length; i++) {
int count = 1;
int prev = nums[i];
for (int j = i + 1; j < nums.length; j++) {
if (nums[j] > prev) {
count++;
prev = nums[j];
}
}
max = Math.max(max, count);
}
return max;
}
}
```

i think it is overtime.