


在M1上使用Rosetta2安装ZeroC-Ice3.6
ZeroC-Ice 3.6 在官网的安装方式为使用brew安装。尝试了一下,一直提示缺少openjdk@8。由于是在M1芯片上进行安装,故始终无法成功。直到我翻出来强制使用Rosetta2安装brew后,尝试在intel版本上安装ice,终于成功。[……]

LeetCode: 121. Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transactio[……]

反转链表
输入一个链表,反转链表后,输出新链表的表头。
ListNode* ReverseList(ListNode* pHead) {
vector<ListNode*> res;
ListNode* temp=nullptr;
res.[......]

链表中倒数第k个结点
输入一个链表,输出该链表中倒数第k个结点。
ListNode* FindKthToTail(ListNode* head, unsigned int k) {
if(!head)return nullptr;
ListNode* tep=head;[......]

调整数组顺序使奇数位于偶数前面
输入一个整数数组,实现一个函数来调整该数组中数字的顺序,使得所有的奇数位于数组的前半部分,所有的偶数位于数组的后半部分,并保证奇数和奇数,偶数和偶数之间的相对位置不变。
void reOrderArray(vector<int> &array) {
ve[......]

LeetCode: 85. Maximal Rectangle
Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing only 1’s and return its area.
class Solution {
public:
in[......]

LeetCode: 84. Largest Rectangle in Histogram
Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the hist[……]

LeetCode:83. Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.
要点
和82一样 遍历一遍,但是pre->next移动到cur的位置,不是cur->next的位置
class So[......]

LeetCode:82. Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.

会长携手GZH与程序喵给您送福啦~
磕就对了
[……]