Length of the longest sorted subsequence
问题 My unsorted array is string[] a = new string[] { "10", "22", "9", "33", "21", "50", "41", "60", "80" }; In this array, 10,22,33,50,60,80 are in ascending order, so the output must be 6 . In general, I want the longest possible length of an ascending list made from elements of the array and starting with the first element. I have tried this : string[] a = new string[] { "10", "22", "9", "33", "21", "50", "41", "60", "80" }; List<int> res = new List<int>(); int arrLength = a.Length; int i = 0;