Mark43 interview question

it was an easy leetcode question