Doubt regarding leetcode problem

Please help me regarding this
I m unable to understand how the output is coming??