Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Find the longest increasing subsequence in an array.

Medium

Problem 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<>(); } }
Log in or sign up to run or submit your code.Log inSign up
Input
[10, 22, 9, 33, 21, 50, 41, 60]
Expected Output
[10, 22, 33, 50, 60]