@@ -0,0 +1,887 @@
+import java.util.Arrays;%0A%0Apublic class LongestIncreasingSubsequence %7B%0A%0A    public int lengthOfLIS(int%5B%5D nums) %7B%0A        if (nums == null %7C%7C nums.length == 0) return 0;%0A        int%5B%5D dp = new int%5Bnums.length%5D;%0A        dp%5B0%5D = 1;%0A        int ans = 1;%0A        for (int i = 1; i %3C nums.length; i++) %7B%0A            int max = 0;%0A            for (int j = 0; j %3C i; j++) %7B%0A                if (nums%5Bj%5D %3C nums%5Bi%5D && dp%5Bj%5D %3E max) %7B%0A                    max = dp%5Bj%5D;%0A                %7D%0A            %7D%0A            dp%5Bi%5D = max + 1;%0A            ans = Math.max(dp%5Bi%5D, ans);%0A        %7D%0A%0A        return ans;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        int%5B%5D nums = %7B10, 9, 2, 5, 3, 7, 101, 18%7D;%0A        System.out.println(Arrays.toString(nums));%0A%0A        LongestIncreasingSubsequence solution = new LongestIncreasingSubsequence();%0A        System.out.println(solution.lengthOfLIS(nums));%0A    %7D%0A%7D

solution of longest increasing subsequence