Wipro NTH Coding Question- 31