Find the longest increasing subsequence in an array.
MediumProblem Statement
Find the longest increasing subsequence in an array.
Sample Input
[10, 22, 9, 33, 21, 50, 41, 60]
Sample Output
[10, 22, 33, 50, 60]
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
import java.util.*;
public class Main {
public static List<Integer> longestIncreasingSubsequence() {
int[] arr = {10, 22, 9, 33, 21, 50, 41, 60};
// Your code here
return new ArrayList<>();
}
}
Input
[10, 22, 9, 33, 21, 50, 41, 60]
Expected Output
[10, 22, 33, 50, 60]