Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions solution/1500-1599/1531.String Compression II/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,24 @@ tags:
### 方法一

<!-- tabs:start -->
#### C++

```cpp
class Solution {
public:
bool winnerSquareGame(int n) {
vector<bool> dp(n + 1, false);
for (int i = 1; i <= n; i++) {
for (int j = 1; j * j <= i; j++) {
if (!dp[i - j * j]) {
dp[i] = true;
break;
}
}
}
return dp[n];
}
};

#### Java

Expand Down
Loading