Leetcode 2312. Selling Pieces of Wood | Hello Interview