Harpreet's Newsletter

Harpreet's Newsletter

Last Stone Weight

Uber Interview Question

Harpreet Singh's avatar
Harpreet Singh
Feb 16, 2026
∙ Paid

Problem Overview

Difficulty: Easy
LeetCode Pattern: Heap

You are given an array of integers stones where stones[i] is the weight of the ith stone.

We are playing a game with the stones.

On each turn, we choose the heaviest two stones and smash them together.

Suppose the heaviest two stones have weights x and y with x <= y.

The result of this smash is:

  • If x =…

User's avatar

Continue reading this post for free, courtesy of Harpreet Singh.

Or purchase a paid subscription.
© 2026 Harpreet Singh · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture