09 2021 档案
摘要:Solution 按位判断 考虑w进制借位 Sample Code #include <bits/stdc++.h> using namespace std; int w, m; void Do(){ if(w == 1) { cout << "YES" << endl; return; } int
阅读全文
摘要:21 简单 Solution 模拟 Sample Code /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nu
阅读全文
摘要:11 中等 Solution 用i, j(i < j)表示选取的两条线位置, 则水量为$(j - i)* min(a_j, a_i)$ 我们考虑固定选取的右侧j, 则左侧可选为1...j - 1 设$i \in [1, j - 1]$, 若存在 \(k \in [1, j - 1] \ \& \ k
阅读全文
摘要:6 中等 Soluion 模拟规律题 找同一行相邻两个字符再原字符串中的间隔 Sample Code (map) class Solution { public: string convert(string s, int numRows) { if(numRows == 1) return s; s
阅读全文
摘要:Motivation 近两年没怎么刷题 研二实践教学,目前任务还算轻松 打算整点时间把LeetCode刷一遍,保持手感 题解形式: 代码 + 口胡(活多的话各位就将就着看) 尽量一天5道题, 就按序来 工作日更新,也调整下目前懒散的学习状态 从csdn移到博客园 旧址:https://blog.cs
阅读全文
摘要:1 简单 Soluion map 排序 + 双指针 Sample Code (map) class Solution { public: map<int, int> mp; map<int, int> pos; vector<int> twoSum(vector<int>& nums, int ta
阅读全文

浙公网安备 33010602011771号