IBM Interview Question

There was 3 coding rounds