2019年11月24日

摘要: 地址 https://leetcode-cn.com/problems/combination-sum-iii/ 解法 DFS 逐个尝试 本代码没加优化 性能一般 阅读全文
posted @ 2019-11-24 20:34 itdef 阅读(189) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/subsets-ii/ 使用DFS 这里取了个巧 使用set做了去重 阅读全文
posted @ 2019-11-24 19:54 itdef 阅读(193) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/remove-duplicates-from-sorted-list/ 由于是 排序链表 那么只要比较当前和下一个元素的值比较 决定删除与否 同样 还是注意边界问题 code 阅读全文
posted @ 2019-11-24 17:56 itdef 阅读(165) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/ 给定一个链表,删除链表的倒数第 n 个节点,并且返回链表的头结点。 示例: 给定一个链表: 1->2->3->4->5, 和 n = 2. 当删除了倒数第二个节 阅读全文
posted @ 2019-11-24 17:45 itdef 阅读(232) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/search-suggestions-system/ 题目描述给你一个产品数组 products 和一个字符串 searchWord ,products 数组中每个产品都是一个字符串。 请你设计一个推荐系统,在依次输入单词 se 阅读全文
posted @ 2019-11-24 15:34 itdef 阅读(517) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/count-servers-that-communicate/ 题目描述这里有一幅服务器分布图,服务器的位置标识在 m * n 的整数矩阵网格 grid 中,1 表示单元格上有服务器,0 表示没有。 如果两台服务器位于同一行或者 阅读全文
posted @ 2019-11-24 15:26 itdef 阅读(389) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/minimum-time-visiting-all-points/submissions/ 题目描述平面上有 n 个点,点的位置用整数坐标表示 points[i] = [xi, yi]。请你计算访问所有这些点需要的最小时间(以秒 阅读全文
posted @ 2019-11-24 15:11 itdef 阅读(522) 评论(0) 推荐(0)

导航