题解 | #Redraiment的走法#
购物单
http://www.nowcoder.com/practice/f9c6f980eeec43ef85be20755ddbeaf4
let arr = readline().split(' ')
let ans = []
let res = 0
function dp(arr){
for(let i = 0;i<arr.length;i++){
ans[i]=1
for(let j=0;j<i;j++){
if(Number(arr[j])<Number(arr[i])){//注意输入为字符串
ans[i] = Math.max(ans[i],ans[j]+1)
}
}
res = Math.max(ans[i],res)
}
console.log(res)
}
dp(arr)