llllmz

导航

2024年3月19日

150. 逆波兰表达式求值c

摘要: int f(int a ,int b,char c){ if(c=='+') return a+b; if(c=='-') return a-b; if(c=='/') return a/b; return a*b; } int evalRPN(char** tokens, int tokensSi 阅读全文

posted @ 2024-03-19 16:42 神奇的萝卜丝 阅读(15) 评论(0) 推荐(0)

459. 重复的子字符串c

摘要: void build(int* next,char* s,int n){ next[0]=-1; int index=1,j=-1; while(index<n){ if(j 1 || s[index-1] == s[j]){ j++; next[index++]=j; }else{ j=next[ 阅读全文

posted @ 2024-03-19 16:22 神奇的萝卜丝 阅读(21) 评论(0) 推荐(0)

28. 找出字符串中第一个匹配项的下标c

摘要: void bulid(int* next,char* s,int n){ next[0]=-1; int index=1,j=-1; while(index<n){ if(j 1 || s[index-1] ==s[j] ){ j++; next[index++]=j; }else{ j=next[ 阅读全文

posted @ 2024-03-19 16:08 神奇的萝卜丝 阅读(19) 评论(0) 推荐(0)

142. 环形链表 II

摘要: /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode *detectCycle(struct ListNode 阅读全文

posted @ 2024-03-19 15:54 神奇的萝卜丝 阅读(16) 评论(0) 推荐(0)

76. 最小覆盖子串c

摘要: bool judge(int* s,int* t){ for(int i=0;i<200;i++){ if(s[i]<t[i]) return false; } return true; } char* minWindow(char* s, char* t) { int ns=strlen(s),n 阅读全文

posted @ 2024-03-19 15:51 神奇的萝卜丝 阅读(16) 评论(0) 推荐(0)