IBM Interview Question

some algorithm questions