上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 44 下一页
摘要: Given a reference of a node in a connected undirected graph, return a deep copy (clone) of the graph. Each node in the graph contains a val (int) and 阅读全文
posted @ 2019-11-11 23:20 自由之翼Az 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 在一条环路上有 N 个加油站,其中第 i 个加油站有汽油 gas[i] 升。 你有一辆油箱容量无限的的汽车,从第 i 个加油站开往第 i+1 个加油站需要消耗汽油 cost[i] 升。你从其中的一个加油站出发,开始时油箱为空。 如果你可以绕环路行驶一周,则返回出发时加油站的编号,否则返回 -1。 说 阅读全文
posted @ 2019-11-11 21:56 自由之翼Az 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 老师想给孩子们分发糖果,有 N 个孩子站成了一条直线,老师会根据每个孩子的表现,预先给他们评分。 你需要按照以下要求,帮助老师给这些孩子分发糖果: 每个孩子至少分配到 1 个糖果。相邻的孩子中,评分高的孩子必须获得更多的糖果。那么这样下来,老师至少需要准备多少颗糖果呢? 示例 1: 输入: [1,0 阅读全文
posted @ 2019-11-11 21:10 自由之翼Az 阅读(211) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runti 阅读全文
posted @ 2019-11-06 23:34 自由之翼Az 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single one. Note: Your al 阅读全文
posted @ 2019-11-06 23:28 自由之翼Az 阅读(179) 评论(0) 推荐(0) 编辑
摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
posted @ 2019-11-06 22:53 自由之翼Az 阅读(321) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequ 阅读全文
posted @ 2019-11-05 23:08 自由之翼Az 阅读(273) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each word is 阅读全文
posted @ 2019-11-02 23:25 自由之翼Az 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the posi 阅读全文
posted @ 2019-11-02 22:28 自由之翼Az 阅读(195) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent a cycle in the given linked list, we use 阅读全文
posted @ 2019-11-02 22:22 自由之翼Az 阅读(156) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 44 下一页