IBM Interview Question

Coding questions were asked like 2