#include #include #include int foo(char *s) { char last=s[0]; int c=1, max=0, i; for (i = 1; i < strlen(s); i++) { if(s[i]==last) c++; if(s[i]!=last || i==strlen(s)-1) { if(c>max) max=c; c=1; } last=s[i]; } return max; }