leetle

Daily challenge for 2026-05-01

486. Frequent Character Difference

Given a string s, find the difference between the frequency of the most frequent character and the least frequent character. Only consider characters that appear at least once in the string.

Example:
Input: s = "aabbbc"
Output: 2
Explanation: 'b' appears 3 times, 'c' appears 1 time. 3 - 1 = 2.

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