20%off off — LaunchSpecial
Exercises/#55 Longest Common Subsequence
#55

Longest Common Subsequence

Medium🧩 Dynamic Programming
90 XP

Problem

Given two strings text1 and text2, return the length of their longest common subsequence.

Examples

Input: text1='abcde', text2='ace'
Output: 3 ('ace')

Input: text1='abc', text2='abc'
Output: 3
dynamic-programmingstring
AI Assistant— powered by AI

Unlock hints progressively — start gentle, go deeper only if needed.

💡

Level 1: Gentle Nudge

A subtle direction

🗺️

Level 2: Approach

The algorithm to use

🔍

Level 3: Detailed

Step-by-step guidance

55 / 150

Your Solution

⚡ JavaScript

to save progress and use AI features