找第一个只出现一次的字符(C语言)(简单) 摘要: #include #include int main() { char a[100000]; gets(a); int y =…… 题解列表 2024年11月25日 1 点赞 0 评论 968 浏览 评分:9.9
2847题: 找第一个只出现一次的字符 摘要:解题思路:双重循环遍历注意事项:int count=0;要在第一个循环内部参考代码: Scanner sc=new Scanner(System.in); String s = s…… 题解列表 2024年03月17日 0 点赞 0 评论 470 浏览 评分:9.9
超简单易懂-数组标记 摘要:解题思路:用一个数组标记字母出现的先后,然后以先后顺序判断该字母是否符合条件输出就好了注意事项: 我看到有些题解的第一个且只出现一次的字母的这个“第一个”是根据字母表的顺序输出的并不是根据输入的数据的…… 题解列表 2024年04月03日 0 点赞 0 评论 400 浏览 评分:9.9
Python编写简单易懂 包含知识点 markdown编写 摘要:``` str1=input() # 字符串的输入 flag=len(str1) # 字符串的长度 for i in str1 : a=str1.find(i) …… 题解列表 2023年07月12日 0 点赞 0 评论 562 浏览 评分:9.9
判断唯一字符-易懂最佳方案 摘要:解题思路:判断字符串是否存在唯一字符 比如 aba ,那么字符'a'最先出现坐标: 0 (str.indexOf("a"))最后出现坐标:2 (str.lastIndexOf…… 题解列表 2024年02月19日 1 点赞 1 评论 480 浏览 评分:9.9
双循环+boolean 摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Main { public static void main(String[] args…… 题解列表 2023年12月20日 0 点赞 0 评论 335 浏览 评分:9.9
题解 2847: 找第一个只出现一次的字符 摘要: #include using namespace std; const int N=100000; char a[N]; int cnt[26]; …… 题解列表 2023年12月19日 0 点赞 0 评论 312 浏览 评分:9.9
双循环遍历 摘要:# 纯纯打表 ```c++ #include #include using namespace std; char str[10000]; int f[26]; int main() …… 题解列表 2023年05月09日 0 点赞 0 评论 378 浏览 评分:9.9
collections.OrderedDict 有序字典 摘要:# 解题思路 1. 通过collections.OrderedDict统计字母个数,以空间换时间,降低查找的时间复杂度。 2. 时间复杂度为O(nlogn),空间复杂度为O(n) # 代码 …… 题解列表 2023年05月22日 0 点赞 1 评论 566 浏览 评分:9.9
2847: 找第一个只出现一次的字符 摘要:解题思路:注意事项:参考代码:n=input()flag=Falsefor i in n: if n.count(i)==1: print(i) flag=True …… 题解列表 2023年11月24日 0 点赞 0 评论 521 浏览 评分:9.9