686. 重复叠加字符串匹配
kmp函数套着用
void nex(char *s, int *next)
{
next[0] = 0;
int now = 0, x = 1;
while (x < strlen(s))
{
if (s[now] == s[x])
{
now+=1;
next[x] = now;
x += 1;
}
e
more...125. 验证回文串
再次验证我菜
bool isPalindrome(char * s){
char strss[500000];
int x=0,y=0;
while(x< strlen(s)){
if((s[x]>='a'&&s[x]<='z')||(s[x]>='0'&&s[x]<='9'))
strss[y]=s[x];
else if (s[x]>
more...35. 搜索插入位置
int searchInsert(int* nums, int numsSize, int target){
if(numsSize ==1){
if(target<=nums[0])
return 0;
return 1;
}
int left=0 , right= numsSize,mid =numsSize/2;
while(right-left>1){
if(target>=nums[mid])
more...