LeetCode 1049 – Last Stone Weight II
1. Problem Overview We are given an array stones[i] representing weights. Each turn: Pick two stones x ≤ y if x == y: both vanish else: new stone = y - x At most one stone remains.Return the smallest possible final weight. Example: Input: [2,7,...