Skip to content

Commit 9b82603

Browse files
committed
Update index.hpp
1 parent 07a7e84 commit 9b82603

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

check-if-it-is-a-good-array/index.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ namespace check_if_it_is_a_good_array
1616
public:
1717
bool isGoodArray(vector<int> &nums)
1818
{
19-
// auto a = std::gcd(15, 20);
20-
int divisor = accumulate<std::vector<int>::iterator, int, int(int, int)>(
21-
nums.begin(), nums.end(), nums[0], gcd);
22-
return divisor == 1;
19+
return 1 == accumulate<std::vector<int>::iterator, int, int(int, int)>(nums.begin(), nums.end(), nums[0], gcd);
2320
}
2421
};
22+
2523
}

0 commit comments

Comments
 (0)