Why does my while loop calculate incorrect value of the string?
Why does my while loop calculate incorrect value of the string? Question: I am trying to find greatest length of a word from the string return it by using values of each letter from alphabets by assigning each letter it’s value as per it’s rank . So for example For a string s = ‘abcd …