摘要:
```C++ class Solution { public: bool isValid(string s) { vector stack; map bra; bra[')'] = '('; bra['}'] = '{'; bra[']'] = '['; for(int i=0;i 阅读全文
摘要:
```C++ class Solution { public: int firstUniqChar(string s) { map a; for(auto c:s){ if(!a.count(c)){ a[c] = 1; } else{ a[c]++; } } for(int i=0;i 阅读全文
摘要:
```C++ class Solution { public: bool repeatedSubstringPattern(string s) { string ss = s + s; string ss_(ss.begin() + 1, ss.end() 1); return (ss_.find( 阅读全文
摘要:
```C++ class Solution { public: bool canConstruct(string ransomNote, string magazine) { map r; map m; for(auto i:ransomNote){ if(r[i]==0){ r[i]... 阅读全文
摘要:
```C++ class Solution { public: string reverseVowels(string s) { set vow = {'a', 'e', 'o', 'i', 'u', 'A', 'E', 'I', 'O', 'U'}; auto left = s.begin(); 阅读全文
摘要:
```C++
class Solution {
public: string addBinary(string a, string b) { string res = ""; int c = 0; int i = a.size() - 1; int j = b.size() - 1; while(i >= 0 ... 阅读全文
摘要:
```C++ include include include class Solution { public: int countBinarySubstrings(string s) { if(s.empty() || s.size() == 1){ std::cout heap_vec; int 阅读全文
摘要:
```C++ class Solution { public: string reverseWords(string s) { auto st = s.begin(); for(auto i = s.begin();i 阅读全文
摘要:
```C++
class Solution {
public: bool judgeCircle(string moves) { int x = 0; int y = 0; for(auto c:moves){ if(c=='U'){ y++; } ... 阅读全文
摘要:
```C++ class Solution { public: string toLowerCase(string str) { for(int i=0;i= 'A' && str[i] 阅读全文
摘要:
```C++
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */
class Solution {
public: bool ... 阅读全文
摘要:
```C++ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListN... 阅读全文