leetle

Daily challenge for 2026-04-23

478. Binary String Reducer

You are given a string s consisting of '0's and '1's. You may repeatedly remove any adjacent pair of different characters, either 01 or 10. After each removal, the remaining parts of the string are joined together. Return the length of the smallest possible string after performing any number of removals.

Example:
Input: s = "1100"
Output: 0

Explanation: Remove the middle 10 to get 10, then remove that pair as well. No characters remain, so the minimum possible length is 0.

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