We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 96aa388 commit a82424bCopy full SHA for a82424b
lib/number/lcm.cpp
@@ -1,7 +1,6 @@
1
ll gcd(ll a, ll b) {
2
- if (a < b)swap(a, b);
3
- if (b == 0)return a;
4
- return gcd(b, a % b);
+ if (b == 0) return a;
+ else return gcd(b, a % b);
5
}
6
7
ll lcm(ll a, ll b) {
0 commit comments