File tree 3 files changed +6
-6
lines changed
solution/1100-1199/1195.Fizz Buzz Multithreaded
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ var permutation = function (s) {
121
121
122
122
``` cpp
123
123
class Solution {
124
- public:
124
+ public:
125
125
void func(string str, int index, set<string >& mySet) {
126
126
if (index == str.size()) {
127
127
// 当轮训到最后一个字符的时候,直接放入set中。加入set结构,是为了避免插入的值重复
@@ -133,7 +133,7 @@ public:
133
133
int temp = index + 1;
134
134
func(str, temp, mySet);
135
135
swap(str[ i] , str[ index] );
136
- }
136
+ }
137
137
}
138
138
}
139
139
@@ -143,7 +143,7 @@ public:
143
143
vector<string> ret;
144
144
for (auto& x : mySet) {
145
145
/* 这一题加入mySet是为了进行结果的去重。
146
- 但由于在最后加入了将set转vector的过程,所以时间复杂度稍高 */
146
+ 但由于在最后加入了将set转vector的过程,所以时间复杂度稍高 */
147
147
ret.push_back(x);
148
148
}
149
149
return ret;
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ var getIntersectionNode = function (headA, headB) {
180
180
* ListNode(int x) : val(x), next(NULL) {}
181
181
* };
182
182
*/
183
-
183
+
184
184
class Solution {
185
185
public:
186
186
ListNode * getIntersectionNode(ListNode * headA, ListNode * headB) {
Original file line number Diff line number Diff line change @@ -99,12 +99,12 @@ public:
99
99
if (0 == index % 15 && index <= n) {
100
100
printFizzBuzz();
101
101
index++;
102
- }
102
+ }
103
103
}
104
104
}
105
105
106
106
void number(function<void(int)> printNumber) {
107
- while (index <= n) {
107
+ while (index <= n) {
108
108
std::lock_guard<std::mutex> lk(mtx);
109
109
if (0 != index % 3 && 0 != index % 5 && index <= n) {
110
110
printNumber(index);
You can’t perform that action at this time.
0 commit comments