TLE in BostonNumber

Hi, I wrote the solution for BostonNumber but while submitting it show TLE in 1 test case. Can you please help me out

CodeLink-> https://ide.codingblocks.com/s/204200

@imsaurabh
I have made some changes in your code. there was some unnecessary calculations.