240. 搜索二维矩阵 II - 力扣(LeetCode)

class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
int i = matrix.size() - 1, j = 0;
while(i >= 0 && j < matrix[0].size())
{
if(matrix[i][j] > target) i--;
else if(matrix[i][j] < target) j++;
else return true;
}
return false;
}
};

class Solution {
public:
ListNode* mergeTwoLists(ListNode* list1, ListNode* list2) {
ListNode* dum = new ListNode(0);
ListNode* cur = dum;
while (list1 != nullptr && list2 != nullptr) {
if (list1->val < list2->val) {
cur->next = list1;
list1 = list1->next;
}
else {
cur->next = list2;
list2 = list2->next;
}
cur = cur->next;
}
cur->next = list1 != nullptr ? list1 : list2;
return dum->next;
}
};





![[dvwa] Command Injection](https://img-blog.csdnimg.cn/direct/6a3b0c1fe9464b2698dfdaba0c1b33ac.png)







](https://img-blog.csdnimg.cn/direct/5d415b04ecc441009ef86cf121ff5eca.png)
![【三十七】【算法分析与设计】STL 练习,凌波微步,栈和排序,吐泡泡,[HNOI2003]操作系统,优先队列自定义类型](https://img-blog.csdnimg.cn/direct/aa9bd5d815c14d6f81afa53b582b7f7b.png)



