Skip to content

Commit e184bfe

Browse files
committed
Update different-ways-to-add-parentheses.cpp
1 parent 890d4b9 commit e184bfe

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

C++/different-ways-to-add-parentheses.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class Solution {
1919
for (int i = start; i < end; ++i) {
2020
const auto cur = input[i];
2121
if (cur == '+' || cur == '-' || cur == '*') {
22-
vector<int> left = move(diffWaysToComputeRecu(input, start, i, lookup));
23-
vector<int> right = move(diffWaysToComputeRecu(input, i + 1, end, lookup));
22+
auto left = diffWaysToComputeRecu(input, start, i, lookup);
23+
auto right = diffWaysToComputeRecu(input, i + 1, end, lookup);
2424
for (const auto& num1 : left) {
2525
for (const auto& num2 : right) {
2626
if (cur == '+') {
@@ -38,7 +38,7 @@ class Solution {
3838
if (result.empty()) {
3939
result.emplace_back(stoi(input.substr(start, end - start)));
4040
}
41-
lookup[start][end] = move(result);
41+
lookup[start][end] = result;
4242
return lookup[start][end];
4343
}
4444
};
@@ -52,8 +52,8 @@ class Solution2 {
5252
for (int i = 0; i < input.size(); ++i) {
5353
const auto cur = input[i];
5454
if (cur == '+' || cur == '-' || cur == '*') {
55-
vector<int> left = move(diffWaysToCompute(input.substr(0, i)));
56-
vector<int> right = move(diffWaysToCompute(input.substr(i + 1)));
55+
auto left = diffWaysToCompute(input.substr(0, i));
56+
auto right = diffWaysToCompute(input.substr(i + 1));
5757
for (const auto& num1 : left) {
5858
for (const auto& num2 : right) {
5959
if (cur == '+') {

0 commit comments

Comments
 (0)