上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 53 下一页
摘要: Given an array A of 0s and 1s, we may change up to K values from 0 to 1. Return the length of the longest (contiguous) subarray that contains only 1s. 阅读全文
posted @ 2020-01-31 00:05 北叶青藤 阅读(147) 评论(0) 推荐(0) 编辑
摘要: In an alien language, surprisingly they also use english lowercase letters, but possibly in a different order. The order of the alphabet is some permu 阅读全文
posted @ 2020-01-30 14:39 北叶青藤 阅读(273) 评论(0) 推荐(0) 编辑
摘要: Given a 01 matrix, find the longest line of consecutive 1 in the matrix. The line could be horizontal, vertical, diagonal or anti-diagonal. Example 1: 阅读全文
posted @ 2019-11-19 04:35 北叶青藤 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 问题一: pi表示取第i个单,di表示送第i个单。di不能在pi的前面。给一个取单送单的顺序,问是否是valid顺序。 1 public boolean isValidOrderList(List<String> list) { 2 Set<String> set = new HashSet<>() 阅读全文
posted @ 2019-11-18 01:56 北叶青藤 阅读(446) 评论(0) 推荐(0) 编辑
摘要: Google Calendar, Outlook, iCal has been banned from your company! So an intrepid engineer has decided to roll their own implementation. Unfortunately 阅读全文
posted @ 2019-11-17 08:05 北叶青藤 阅读(576) 评论(0) 推荐(0) 编辑
摘要: Implement a SnapshotArray that supports the following interface: SnapshotArray(int length) initializes an array-like data structure with the given len 阅读全文
posted @ 2019-09-18 12:29 北叶青藤 阅读(397) 评论(0) 推荐(0) 编辑
摘要: Question: Detect cycle in a directed graph Answer: Depth First Traversal can be used to detect cycle in a Graph. DFS for a connected graph produces a 阅读全文
posted @ 2019-09-09 14:43 北叶青藤 阅读(421) 评论(0) 推荐(0) 编辑
摘要: Quick Sort: Time complexity: best case O(n*lgn), worst case O(n^2) Space complexity: Best case O(lgn) -> call stack height Worse case O(n^2) -> call s 阅读全文
posted @ 2019-09-09 07:51 北叶青藤 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Given an undirected graph, return true if and only if it is bipartite. Recall that a graph is bipartite if we can split it's set of nodes into two ind 阅读全文
posted @ 2019-08-29 13:31 北叶青藤 阅读(309) 评论(0) 推荐(0) 编辑
摘要: Assume you have k<=10^5 intervals [a_i, b_i] \in [1,10^18] (some of them may overlap), and you need to choose a set of intervals mutually disjoint suc 阅读全文
posted @ 2019-08-23 15:11 北叶青藤 阅读(435) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 53 下一页