Wipro NTH Coding Question- 39