LeetCode 149. Max Points on a Line

1
2
3
4
5
6
7
8
9
static auto x = []()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    return 0;
}();
class Solution {
public:
    int maxPoints([......]<p class="read-more"><a href="https://www.gerrytang.top/?p=854">Read more</a></p>

LeetCode 52. N-Queens II

1
2
3
4
5
6
7
8
9
static auto x = []()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    return 0;
}();
class Solution {
private:
    int ret;[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=850">Read more</a></p>

LeetCode 187. Repeated DNA Sequences

1
2
3
4
5
6
7
8
9
static auto x = []()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    return 0;
}();
class Solution {
public:
    vector findRep[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=846">Read more</a></p>

LeetCode 872. Leaf-Similar Trees

1
2
3
4
5
6
7
8
static auto x = []()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    return 0;
}();
/**
 * Definition for a binary tree node.[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=843">Read more</a></p>

LeetCode 1154. Day of the Year

1
2
3
4
class Solution {
    static int[] arr={0,31,59,90,120,151,181,212,243,273,304,334};
    public int dayOfYear(String date) {
        String[] date[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=839">Read more</a></p>

LeetCode 443. String Compression

1
2
3
4
5
6
7
8
9
static auto x = []()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    return 0;
}();
class Solution {
public:
    int compress(v[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=836">Read more</a></p>

LeetCode 593. Valid Square

1
2
3
4
5
6
7
8
9
static auto x = []()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    return 0;
}();
class Solution {
private:
    bool isVertic[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=834">Read more</a></p>

LeetCode 278. First Bad Version

1
2
3
4
5
// Forward declaration of isBadVersion API.
bool isBadVersion(int version);

int firstBadVersion(int n) {
    if(isBadVersion(1))return 1;[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=832">Read more</a></p>

LeetCode 494. Target Sum

1
2
3
4
5
6
7
8
9
static auto x = []()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    return 0;
}();
class Solution {
private:
    int getSum(ve[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=830">Read more</a></p>