int lengthOfLongestSubstring(char * s){
int len=strlen(s);
if (len==0)
{
return 0;
}
else if (len==1)
{
return 1;
}
int i;
int max=0;
int left=0;
int right=0;
while (right<len)
{
max=(right-left+1)>max?(right-left+1):max;
for (i=left;i<=right;i++)
{
if (s[i]==s[right+1])
{
left=i+1;
}
}
right++;
}
return max;
}