Dina Goldin,Ricardo Mardales,George Nagy.In search of meaning for time series subsequence clustering: matching algorithms based on a new distance measure. Proceedings of the 15th ACM international conference on Information and knowledge management . 2006...
Detail: For a string, every subsequence's length is at least 1. During initialization, all the dp values should be set to 1. Have a look at the complete version:public int lengthOfLIS(int[] nums) { int[] dp = new int[nums.length]; // set all the dp values to 1 Arrays.fi...