```
## [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/)
- Given an integer array return the length of the longest strictly increasing subsequence.
- A subsequence is a sequence that can be derived from an array by deleting some or no elements without changing the order of the remaining elements. For example, [3,6,2,7] is a subsequence of the array [0,3,1,6,2,2,7].
- Example 1:
```c++
Input: nums = [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.
```
# [Self youtube video](https://youtu.be/mqbCl4kyDmQ)
## Logic(Dynamic Programming)
1. Create a Array `dp` containing longest subsequnce till particular element. Initialize array by 1.
```c++
vecArr: 10 9 2 5 3 7 101 18
dp: 1 1 1 1 1 1 1 1
Final dp: 1 1 1 2 2 3 4 4
```
2. Take 2 pointers i and j. i will point to element whose lis need to be calculated and j will start from index=0
```

This file has been truncated. show original