Merkle interview question

Simple window function sum SQL question