非商业,LeetCode链接附上: https://leetcode-cn.com/problems/remove-duplicate-node-lcci/ 进入正题。 题目: 编写代码,移除未排序链表中的重复节点。保留最开始出现的节点。 示例: 示例1: 输入:[1, 2, 3, 3, 2, 1] ...
分类:
其他好文 时间:
2020-12-01 12:35:57
阅读次数:
10
https://pintia.cn/problem-sets/1218774283169423360/problems/1218774532776648715 #include <cstdio> #include <iostream> #include <algorithm> #include <s ...
分类:
其他好文 时间:
2020-11-27 11:32:22
阅读次数:
6
link /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NUL ...
分类:
其他好文 时间:
2020-11-27 11:14:59
阅读次数:
5
非商业,LeetCode链接附上: https://leetcode-cn.com/problems/find-lucky-integer-in-an-array/ 进入正题。 题目: 在整数数组中,如果一个整数的出现频次和它的数值大小相等,我们就称这个整数为「幸运数」。 给你一个整数数组 arr, ...
分类:
编程语言 时间:
2020-11-26 15:13:13
阅读次数:
5
1、面试题 17.10. 主要元素 https://leetcode-cn.com/problems/find-majority-element-lcci/ 考点: class Solution: def majorityElement(self, nums: List[int]) -> int: ...
分类:
编程语言 时间:
2020-11-25 12:48:30
阅读次数:
8
非商业,LeetCode链接附上: https://leetcode-cn.com/problems/word-pattern/ 进入正题。 题目: 给定一种规律 pattern 和一个字符串 str ,判断 str 是否遵循相同的规律。 这里的 遵循 指完全匹配,例如, pattern 里的每个字 ...
分类:
其他好文 时间:
2020-11-25 12:43:50
阅读次数:
7
此博客链接: 字符串相加 题目链接:https://leetcode-cn.com/problems/add-strings/ 题目 给定两个字符串形式的非负整数 num1 和num2 ,计算它们的和。 提示: num1 和num2 的长度都小于 5100num1 和num2 都只包含数字 0-9n ...
分类:
其他好文 时间:
2020-11-25 12:07:41
阅读次数:
23
Difficulty: Medium Related Topics: Depth-first Search, Breadth-first Search, Union Find Link: https://leetcode.com/problems/number-of-islands/ Descrip ...
分类:
其他好文 时间:
2020-11-23 12:25:21
阅读次数:
3
Difficulty: Medium Related Topics: String, Backtracking Link: https://leetcode.com/problems/letter-combinations-of-a-phone-number/ Description Given a ...
分类:
移动开发 时间:
2020-11-21 12:45:15
阅读次数:
31
题目链接:https://leetcode-cn.com/problems/relative-sort-array/ 又是一个简单题,懒得多说了,我用的暴力,有价值的地方就是题解用的这种自定义排序的方法, 之前没写过这样的自定义排序,码住。 class Solution { public: vect ...
分类:
编程语言 时间:
2020-11-19 12:44:37
阅读次数:
7