collections.OrderedDict 有序字典 摘要:# 解题思路 1. 通过collections.OrderedDict统计字母个数,以空间换时间,降低查找的时间复杂度。 2. 时间复杂度为O(nlogn),空间复杂度为O(n) # 代码 …… 题解列表 2023年05月22日 0 点赞 1 评论 594 浏览 评分:9.9
双循环遍历 摘要:# 纯纯打表 ```c++ #include #include using namespace std; char str[10000]; int f[26]; int main() …… 题解列表 2023年05月09日 0 点赞 0 评论 407 浏览 评分:9.9
continue,break 摘要:解题思路:注意事项:参考代码:#include<stdio.h> #include<string.h> int main() { char A[100001]; scanf(…… 题解列表 2023年04月09日 0 点赞 0 评论 299 浏览 评分:0.0
字符串--2.找第一个只出现一次的字符 摘要:解题思路:注意事项:遇到求字符串中类似于字符个数这种题,想到先用strlen(str),后用双循环挨个进行比较;参考代码:#include<stdio.h> #include<string.h> …… 题解列表 2023年03月24日 0 点赞 0 评论 372 浏览 评分:0.0
c语言。。。 摘要:参考代码:#include <stdio.h>#include <string.h>#define NO_OF_CHARS 256char getFirstNonRepeatingChar(char*…… 题解列表 2023年03月19日 0 点赞 0 评论 392 浏览 评分:0.0
找第一个只出现一次的字符 摘要:#include<stdio.h> #include<math.h> #include<string.h> # define N 100001 int main() { c…… 题解列表 2023年03月05日 0 点赞 0 评论 258 浏览 评分:0.0
两个for 循环搞定 摘要:解题思路:用string.h函数,变量len 来进行字符串长度的统计,确定for 语句中的范围利用变量i和变量进行循环嵌套,外循环来进行判断每个数是否在数组中有与之相同 的数如有相同数则用sum来进行…… 题解列表 2023年02月07日 0 点赞 1 评论 868 浏览 评分:8.7
找第一个只出现一次的字符(代码简短) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i,count[26]={0}; char str[100000]; gets(str); f…… 题解列表 2023年02月05日 0 点赞 0 评论 342 浏览 评分:0.0
2847: 找第一个只出现一次的字符 摘要:解题思路:注意事项:参考代码:#include <stdio.h> #include <string.h> int main() { char a[100000] = {0}; int …… 题解列表 2023年01月17日 0 点赞 0 评论 637 浏览 评分:7.3
简单方法(两个循环比较) 摘要:```c #include #include //strlen函数需要调用 int main() { char str[100001],out; int len, sum;…… 题解列表 2023年01月17日 1 点赞 8 评论 1101 浏览 评分:10.0