forked from liuyubobobo/Play-Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain5.cpp
More file actions
36 lines (27 loc) · 740 Bytes
/
Copy pathmain5.cpp
File metadata and controls
36 lines (27 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/// Source : https://leetcode.com/problems/stone-game/description/
/// Author : liuyubobobo
/// Time : 2018-08-03
#include <iostream>
#include <vector>
using namespace std;
/// Mathematic, the answer will always be true!
/// Since the player can technically take all the stones from even-index piles,
/// or take all the stones from odd-index piles
/// One of the two strategy must win:)
///
/// Time Complexity: O(1)
/// Space Complexity: O(1)
class Solution {
public:
bool stoneGame(vector<int>& piles) {
return true;
}
};
void print_bool(bool res){
cout << (res ? "True" : "False") << endl;
}
int main() {
vector<int> piles1 = {5, 3, 4, 5};
print_bool(Solution().stoneGame(piles1));
return 0;
}