Java后端面试自我复习
无助的产品经理
http://www.nowcoder.com/practice/5f451f03032c44858fcb90e677559810
Java基础: 两层for循环就OK了
public int lengthOfLIS (int[] nums) {
// write code here
int result = 0;
for ( int i = 0; i < nums.length; i++){
int flag=1;
int per = nums[i];
for(int j = i+1; j < nums.length; j++){
if(per < nums[j] ) {
flag++;
per = nums[j];
}
}
if(flag > result) result = flag;
}
return result;
}
}