We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c259b13 commit c77d682Copy full SHA for c77d682
C++/letter-combinations-of-a-phone-number.cpp
@@ -16,12 +16,12 @@ class Solution {
16
}
17
vector<string> result;
18
for (int i = 0; i < total; ++i) {
19
- int k = i, base = total;
+ int base = total;
20
string curr;
21
for (const auto& digit : digits) {
22
const auto& choices = lookup[digit - '0'];
23
base /= size(choices);
24
- curr.push_back(choices[(k / base) % size(choices)]);
+ curr.push_back(choices[(i / base) % size(choices)]);
25
26
result.emplace_back(move(curr));
27
0 commit comments