The Love-Letter Mystery

  • + 0 comments

    Simple C Solution

    int theLoveLetterMystery(char* s) {
        int i=0,j=strlen(s)-1,count=0;
        while(i<j){
        if(s[i]!=s[j]) count +=abs(s[i]-s[j]);
        i++;
        j--;
        }
        return count;
    }