Leetcode_3

来源:互联网 发布:数据删除恢复软件 编辑:程序博客网 时间:2024/06/05 04:20


 long length=strlen(s);    int result = 0;    int count = 0;    while (count<length) {        int i=count;        int j=i+1;        while (j<length) {            i=count;            bool notfound=true;            while (i<j&&i<length) {                if(s[i]==s[j]){                    notfound=false;                    break;                }                else{                    i++;                }            }            if(notfound)                j++;            else                break;        }        if(result<(j-count)){            result=j-count;        }        count++;    }    return result;


0 0
原创粉丝点击