
Leetcode 数据结构 Python
Leetcode 数据结构 Python
朵拉刷题记录
这个作者很懒,什么都没留下…
展开
-
Remove Linked List Elements 删除链表中的元素
删除链表中的元素 删除链表中等于给定值 val 的所有节点。 样例 样例 1: 输入:head = 1->2->3->3->4->5->3->null, val = 3 输出:1->2->4->5->null 样例 2: 输入:head = 1->1->null, val = 1 输出:null 思路 遍历整个链表,当遇到元素和给定数值相等,则跳过该node,将上一个node的next属性修改为当下这个node的next属性。所以原创 2020-08-10 03:54:14 · 268 阅读 · 0 评论 -
Leetcode 1417. Reformat The String Python3解法
Leetcode 1417. Reformat The String Python3解法 Given alphanumeric string s. (Alphanumeric string is a string consisting of lowercase English letters and digits). You have to find a permutation of the string where no letter is followed by another letter and n原创 2020-06-15 07:31:38 · 208 阅读 · 0 评论