LNRD by Eulerity interview question

Leetcode - Hard Problem