LeetCode 113. Path Sum II

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=622">Read more</a></p>

LeetCode 36. Valid Sudoku

1
2
3
bool isValidSudoku(char** board, int boardSize, int* boardColSize){
    bool** rowArr=(bool**)malloc(sizeof(bool*)*9);
    for(int i=0;i[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=620">Read more</a></p>

LeetCode 54. Spiral Matrix

1
2
3
4
/**
 * Note: The returned array must be malloced, assume caller calls free().
 */

int* spiralOrder(int** matrix, int matrixSize, int* matrixC[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=618">Read more</a></p>

LeetCode 24. Swap Nodes in Pairs

1
2
3
4
5
6
7
8
9
10
/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     struct ListNode *next;
 * };
 */



struct ListNode* s[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=616">Read more</a></p>

LeetCode 50. Pow(x, n)

1
2
3
4
5
6
7
double myPow(double x, int n){
    if(n==0)return 1;
    else if(n>1));
            return 1/(t*t);
        }
        else{
            return[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=614">Read more</a></p>

LeetCode 19. Remove Nth Node From End of List

1
2
3
4
5
6
7
8
9
10
/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     struct ListNode *next;
 * };
 */



struct ListNode* r[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=610">Read more</a></p>

LeetCode 12. Integer to Roman

1
2
3
class Solution {
    static final String[] MArr={"","M","MM","MMM"};
    static final String[] CArr={"","C","CC","CCC","CD","D","DC","DCC","DCCC",[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=608">Read more</a></p>

LeetCode 559. Maximum Depth of N-ary Tree

1
2
3
4
5
6
7
8
9
10
/*
// Definition for a Node.
class Node {
public:
    int val;
    vector children;

    Node() {}

    Node(int _val, vector _children) {[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=606">Read more</a></p>