diff --git "a/problems/0027.\346\234\200\351\225\277\345\242\236\351\225\277\345\255\220\345\272\217\345\210\227.md" "b/problems/0027.\346\234\200\351\225\277\345\242\236\351\225\277\345\255\220\345\272\217\345\210\227.md" index 7ad80a09a9cfd34fc9aa8ee75d094cf1e8c3969c..03e02c09c28cfeea102ea29918eb1df3572d95f4 100644 --- "a/problems/0027.\346\234\200\351\225\277\345\242\236\351\225\277\345\255\220\345\272\217\345\210\227.md" +++ "b/problems/0027.\346\234\200\351\225\277\345\242\236\351\225\277\345\255\220\345\272\217\345\210\227.md" @@ -48,7 +48,19 @@ public class Main { ``` ## Python - +```python +n = int(input()) +for i in range(n): + strings = input().replace('[','').replace(']','') + nums = list(map(int,strings.split(','))) + n = len(nums) + dp = [1]*(n) + for i in range(n): + for j in range(i): + if(nums[i] > nums[j]): + dp[i] = max(dp[i],dp[j] + 1) + print(max(dp)) +``` ## Go ## Js