HCLTech Interview Question

2 coding Questions one is difficult and other one is easy