摘要: 题目 剑指 Offer 18. 删除链表的节点 代码 class Solution { public: ListNode* deleteNode(ListNode* head, int val) { if(head->val == val) return head->next; auto pre = 阅读全文
posted @ 2022-04-21 15:27 当惜 阅读(16) 评论(0) 推荐(0)
摘要: 题目 剑指 Offer 17. 打印从1到最大的n位数 代码 傻瓜做法(不考虑大数) class Solution { public: vector<int> printNumbers(int n) { int sum = 1; vector<int> res; for(int i = 0; i < 阅读全文
posted @ 2022-04-21 15:06 当惜 阅读(20) 评论(0) 推荐(0)