collections.OrderedDict 有序字典 摘要:# 解题思路 1. 通过collections.OrderedDict统计字母个数,以空间换时间,降低查找的时间复杂度。 2. 时间复杂度为O(nlogn),空间复杂度为O(n) # 代码 …… 题解列表 2023年05月22日 0 点赞 1 评论 682 浏览 评分:9.9
题解 2847: 找第一个只出现一次的字符 摘要: #include using namespace std; const int N=100000; char a[N]; int cnt[26]; …… 题解列表 2023年12月19日 0 点赞 0 评论 379 浏览 评分:9.9
超简单易懂-数组标记 摘要:解题思路:用一个数组标记字母出现的先后,然后以先后顺序判断该字母是否符合条件输出就好了注意事项: 我看到有些题解的第一个且只出现一次的字母的这个“第一个”是根据字母表的顺序输出的并不是根据输入的数据的…… 题解列表 2024年04月03日 0 点赞 0 评论 494 浏览 评分:9.9
双循环遍历 摘要:# 纯纯打表 ```c++ #include #include using namespace std; char str[10000]; int f[26]; int main() …… 题解列表 2023年05月09日 0 点赞 0 评论 487 浏览 评分:9.9
双循环+boolean 摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Main { public static void main(String[] args…… 题解列表 2023年12月20日 0 点赞 0 评论 423 浏览 评分:9.9
2847题: 找第一个只出现一次的字符 摘要:解题思路:双重循环遍历注意事项:int count=0;要在第一个循环内部参考代码: Scanner sc=new Scanner(System.in); String s = s…… 题解列表 2024年03月17日 0 点赞 0 评论 571 浏览 评分:9.9
判断唯一字符-易懂最佳方案 摘要:解题思路:判断字符串是否存在唯一字符 比如 aba ,那么字符'a'最先出现坐标: 0 (str.indexOf("a"))最后出现坐标:2 (str.lastIndexOf…… 题解列表 2024年02月19日 1 点赞 1 评论 573 浏览 评分:9.9
简单方法(两个循环比较) 摘要:```c #include #include //strlen函数需要调用 int main() { char str[100001],out; int len, sum;…… 题解列表 2023年01月17日 1 点赞 8 评论 1167 浏览 评分:10.0
2847:找第一个只出现一次的字符 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ char str[100000]; int coun…… 题解列表 2025年10月31日 0 点赞 0 评论 483 浏览 评分:10.0