Daily Challenge

January 15, 2026

Longest Common Subsequence

Dynamic Programming Hard 50 points

Find the length of the longest common subsequence between two strings.

Success Rate
0%

Problem Statement

Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0.

A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

For example, "ace" is a subsequence of "abcde".

A common subsequence of two strings is a subsequence that is common to both strings.

Examples

Input:

text1 = "abcde", text2 = "ace"

Output:

3

Explanation:

The longest common subsequence is "ace" and its length is 3.

0 attempts today 3 languages

Previous Daily Challenges

Reverse String

Jan 13, 2026
Beginner

Write a function that reverses a string.

Personal Finance Tracker

Jan 12, 2026
Medium

Build a comprehensive personal finance tracking application.

Fibonacci Sequence

Jan 11, 2026
Easy

Calculate the nth Fibonacci number.

Binary Tree Inorder Traversal

Jan 10, 2026
Medium

Return the inorder traversal of a binary tree.

E-commerce Inventory Management System

Jan 9, 2026
Hard

Build a complete inventory management system for an e-commerce platform.

120 points View Challenge

Social Media Analytics Dashboard

Jan 6, 2026
Hard

Build a comprehensive social media analytics dashboard with data visualization.

150 points View Challenge