IBM interview question

coding assessment where they asked 2 question