int lengthOfLastWord(char* s) {

```
int length= strlen(s);
if (length==0) {
return 0;
}
int lastlen = 0;
while (length >0 && s[length] != ' ') {
lastlen ++;
length --;
}
return lastlen;
```

}

Outcome:

Input:

" "

Output:

1

Expected:

0