I have submitted these two codes first and second where first once works and second doesn't. It caused me two runtime errors. I guess the input file contains some extra spaces. Correct me if i'm wrong. If it contains extra spaces then how to deal with that using the second code.