leetle

Daily challenge for 2026-05-25

510. Destroy Matching Blocks

Given a list of integers blocks, whenever two adjacent blocks have the same value, they destroy each other and are removed from the list. This process continues until no more adjacent matching blocks exist. Return the final list of blocks.

Example:
Input: blocks = [1, 2, 2, 1, 3]
Output: [3]

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