GoLang Solution For LeetCode Problem: Longest Increasing Subsequence
Solving Longest Increasing Subsequence in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.
Given an unsorted array of integers, find the length of longest increasing subsequence.
Input: [10,9,2,5,3,7,101,18] Output: 4 Explanation: The longest increasing subsequence is [2,3,7,101], therefore the length is 4.
- There may be more than one LIS combination, it is only necessary for you to return the length.
- Your algorithm should run in O(n^2) complexity.
len = 1 : , , ,  => tails = 3 len = 2 : [4, 5], [5, 6] => tails = 5 len = 3 : [4, 5, 6] => tails = 6
See the full details of the problem Longest Increasing Subsequence at LeetCode
Originally posted at: @github.com/halfrost/LeetCode-Go