BigRoad interview question

Basic leet code search question - easy level