04.11 · Problem
Longest Common Subsequence
A subsequence keeps some characters in their order (you may skip any). “ace” is a subsequence of “abcde”. Return the length of the longest subsequence that both strings share.
Examples
Example 1
Input: text1 = "abcde", text2 = "ace"
Output: 3solulu Pro
Continue this problem with Pro
Inside: step-by-step hints · 11 hidden tests · reference solutions · code editor.
Lifetime ₹1,999 ₹999 · Launch offer
Item 37 of 44 · updated 2026-10-13