SambaNova Interview Question

The question was a leetcode hard.