"第一题" 判断字符串是不是子串,效率高的方式应该是字典树,按照字典序排序后,建树,再建的过程中就可以得到答案。 但是这是比赛中,又是第一题,所以直接用contains了 c "第三题" 很简单的一道字符串替换的题目 ...
分类:
其他好文 时间:
2020-04-12 14:04:16
阅读次数:
73
地址:https://leetcode cn.com/problems/remove linked list elements/ 大意:删除链表中等于给定值的所有节点。 ` ` ...
分类:
其他好文 时间:
2020-04-12 08:20:40
阅读次数:
49
地址:https://leetcode cn.com/problems/merge two sorted lists/ 大意:将两个升序链表合并为一个新的升序链表并返回。 ` ` ...
分类:
其他好文 时间:
2020-04-12 08:04:53
阅读次数:
74
地址:https://leetcode cn.com/problems/add two numbers/submissions/ 大意:给定两个链表,返回一个由这两个链表相加而得到的新链表 ` ` ...
分类:
其他好文 时间:
2020-04-12 07:53:08
阅读次数:
55
地址:https://leetcode cn.com/problems/longest increasing subsequence/ 大意:给定一个数组,找到最长上升子序列 ` ` ...
分类:
其他好文 时间:
2020-04-12 07:52:21
阅读次数:
78
地址:https://leetcode-cn.com/problems/implement-queue-using-stacks/ <?php /** 232. 用栈实现队列 使用栈实现队列的下列操作: push(x) -- 将一个元素放入队列的尾部。 pop() -- 从队列首部移除元素。 pee ...
分类:
其他好文 时间:
2020-04-11 16:56:35
阅读次数:
74
题目描述 给定一个链表和一个特定值 x,对链表进行分隔,使得所有小于 x 的节点都在大于或等于 x 的节点之前。 你应当保留两个分区中每个节点的初始相对位置。 示例: 题目链接: https://leetcode cn.com/problems/partition list/ 思路 x会将链表分割成 ...
分类:
其他好文 时间:
2020-04-10 21:16:33
阅读次数:
69
F. Independent Set 题意: all the vertices in the original graph that are incident on at least one edge in the subgraph.这句话不太理解 edge-induced subgraph(诱导子 ...
分类:
其他好文 时间:
2020-04-10 21:16:00
阅读次数:
92
试题地址:https://leetcode-cn.com/problems/reverse-words-in-a-string/ 试题思路: go自带strings.Fields()函数,可以剔除多余空格 试题代码: func reverseWords(s string) string { strL ...
分类:
其他好文 时间:
2020-04-10 14:45:08
阅读次数:
72
题目描述 给定一个排序链表,删除所有含有重复数字的节点,只保留原始链表中 没有重复出现 的数字。 示例: 题目链接 :https://leetcode cn.com/problems/remove duplicates from sorted list ii/ 做这题之前,可以先做 "删除排序链表中 ...
分类:
编程语言 时间:
2020-04-10 00:36:26
阅读次数:
74