Medium
Alice and Bob Playing Flower Game — C++
Full explanation · Time O(1) · Space O(1)
// Time: O(1)
// Space: O(1)
// combinatorics
class Solution {
public:
long long flowerGame(int n, int m) {
return (1ll * n * m) / 2;
}
};
Full explanation · Time O(1) · Space O(1)
// Time: O(1)
// Space: O(1)
// combinatorics
class Solution {
public:
long long flowerGame(int n, int m) {
return (1ll * n * m) / 2;
}
};