leetle

Daily challenge for 2026-02-15

411. Longest Substring With Two Distinct

Given a string s, find the length of the longest substring that contains at most two distinct characters.

Example:
Input: s = "eceba" Output: 3 because "ece" is the longest substring with 2 distinct characters.

Run this challenge interactively in Python or JavaScript when the app loads.