Timeline
Timeline
2025-11-09
init
Simulation
Problem:
Weekend bonus problem
12345678910111213141516 | class Solution { public: int countOperations(int num1, int num2) { int ops = 0; while (num1 != 0 && num2 != 0) { if (num1 < num2) { //num1 is the larger one std::swap(num1, num2); } num1 = num1 - num2; ops++; } return ops; }}; |
