HP Inc. interview question

I was asked easy leetcode problems