int lengthOfLastWord(char * s){
    int i,len=strlen(s),count=0;
    for (i=len-1; i>=0; i--)
    {
        if (s[i] != ' ') count++;
        else if (count>0 && s[i] == ' ') break;
    }
    return count;
}