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...58. 最后一个单词的长度
int lengthOfLastWord(char * s){
if(strlen(s) == 0)
return 0;
int x =strlen(s)-1;
while(s[x]==' '){
x-=1;
if(x<0)
return 0;
}
int j = 0;
while(s[x]!= ' '){
x-=1;
j+=1;
if(x<0)
more...28. 实现 strStr()
int strStr(char * haystack, char * needle){
if(strlen(needle) == 0)
return 0;
if(strlen(haystack) ==0||strlen(haystack) <strlen(needle))
return -1;
int x=0,y=0,sta=0;
while(x <=strlen(haystack)-strlen(needle)){
if(haystack[x] ==
more...