LeetCode 925. Long Pressed Name

1
2
3
4
5
6
7
8
bool isLongPressedName(char* name, char* typed) {
    char* n=name;
    char* t=typed;
    if(*n!=*t){
        return false;
    }
   
    w[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=427">Read more</a></p>

LeetCode 537. Complex Number Multiplication

1
2
3
4
5
char* complexNumberMultiply(char* a, char* b) {
    int a1,a2,b1,b2;
    sscanf(a, "%d+%di", &a1,&a2);
    sscanf(b, "%d+%di", &b1,&b2);
    int[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=423">Read more</a></p>

LeetCode 989. Add to Array-Form of Integer

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 addToAr[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=421">Read more</a></p>

LeetCode 991. Broken Calculator

1
2
3
4
5
int brokenCalc(int X, int Y) {
    if(X==Y)return 0;
    else if(X>Y) return X-Y;
    else if((Y&1)==0) return brokenCalc(X,Y>>1)+1;
    else retur[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=419">Read more</a></p>

LeetCode 919. Complete Binary Tree Inserter

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

LeetCode 165. Compare Version Numbers

1
2
3
4
5
char* compareVersionHelper(char* version,int* v){
    char* t=version;
    *v=0;
    while(*t!='\0'&&*t!='.'){
        *v=*v*10+(*t-'0');[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=413">Read more</a></p>

LeetCode 216. Combination Sum III

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:
    void combinat[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=411">Read more</a></p>

LeetCode 40. Combination Sum 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:
   void combinati[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=409">Read more</a></p>

LeetCode 518. Coin Change 2

1
2
3
4
5
int change(int amount, int* coins, int coinsSize) {
    int* dp=(int*)calloc(amount+1,sizeof(int));
    dp[0]=1;
   
    for(int i=0;i[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=407">Read more</a></p>