
leetcode
叶赫那拉肉肉
https://github.com/niununu
展开
-
LeetCode-面试题 01.01. 判定字符是否唯一
/* 面试题 01.01. 判定字符是否唯一 实现一个算法,确定一个字符串 s 的所有字符是否全都不同。 */ public: bool isUnique(std::string astr) { bool unique = true; std::vector<bool> book (26 * 2, false); for (int i = 0; i < astr.length(); ++i) { .原创 2021-12-28 15:05:23 · 496 阅读 · 0 评论 -
LeetCode-3-给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度
/* 3.给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。 */ public: int lengthOfLongestSubstring(std::string s) { int Longest = 0; int current_index = 0; while(current_index != s.length()) { int substrLenth = 0; .原创 2021-12-28 15:00:27 · 586 阅读 · 0 评论