Why is this code not working for this problem?

Why is this code not working for this problem?


@cbcao263
Will get back to you asap

@cbcao263

This is the updated code. Go through it once and revert in case you face any difficulty.