随笔分类 -  Level 2

上一页 1 2 3 4 5 6 7 8 ··· 12 下一页
摘要:Given an array A of integers, return the length of the longest arithmetic subsequence in A. Recall that a subsequence of A is a list A[i_1], A[i_2], . 阅读全文
posted @ 2020-02-03 11:42 北叶青藤 阅读(187) 评论(0) 推荐(0)
摘要:We are given a binary tree (with root node root), a target node, and an integer value K. Return a list of the values of all nodes that have a distance 阅读全文
posted @ 2020-02-02 23:55 北叶青藤 阅读(193) 评论(0) 推荐(0)
摘要: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 北叶青藤 阅读(155) 评论(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 北叶青藤 阅读(209) 评论(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 北叶青藤 阅读(461) 评论(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 北叶青藤 阅读(598) 评论(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 北叶青藤 阅读(411) 评论(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 北叶青藤 阅读(314) 评论(0) 推荐(0)
摘要:Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be 阅读全文
posted @ 2019-08-18 03:14 北叶青藤 阅读(159) 评论(0) 推荐(0)
摘要:Given a 01 matrix M, find the longest line of consecutive one in the matrix. The line could be horizontal, vertical, diagonal or anti-diagonal. Exampl 阅读全文
posted @ 2019-08-16 12:18 北叶青藤 阅读(205) 评论(0) 推荐(0)
摘要:Design a HashSet without using any built-in hash table libraries. To be specific, your design should include these functions: add(value): Insert a val 阅读全文
posted @ 2019-08-11 10:20 北叶青藤 阅读(180) 评论(0) 推荐(0)
摘要:Design your implementation of the circular double-ended queue (deque). Your implementation should support following operations: MyCircularDeque(k): Co 阅读全文
posted @ 2019-08-11 09:46 北叶青藤 阅读(224) 评论(0) 推荐(0)
摘要:Design your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (F 阅读全文
posted @ 2019-08-11 09:02 北叶青藤 阅读(225) 评论(0) 推荐(0)
摘要:Design your implementation of the linked list. You can choose to use the singly linked list or the doubly linked list. A node in a singly linked list 阅读全文
posted @ 2019-08-11 02:58 北叶青藤 阅读(261) 评论(0) 推荐(0)
摘要:Design a Phone Directory which supports the following operations: get: Provide a number which is not assigned to anyone.check: Check if a number is av 阅读全文
posted @ 2019-08-11 02:21 北叶青藤 阅读(206) 评论(0) 推荐(0)
摘要:Let's play the minesweeper game (Wikipedia, online game)! You are given a 2D char matrix representing the game board. 'M' represents an unrevealed min 阅读全文
posted @ 2019-08-08 14:41 北叶青藤 阅读(702) 评论(0) 推荐(0)
摘要:Infix : An expression is called the Infix expression if the operator appears in between the operands in the expression. Simply of the form (operand1 o 阅读全文
posted @ 2019-08-08 00:35 北叶青藤 阅读(457) 评论(0) 推荐(0)
摘要:Infix expression: The expression of the form a op b. When an operator is in-between every pair of operands.Postfix expression: The expression of the f 阅读全文
posted @ 2019-08-08 00:24 北叶青藤 阅读(288) 评论(0) 推荐(0)
摘要:Postfix to Prefix Conversion Postfix: An expression is called the postfix expression if the operator appears in the expression after the operands. Sim 阅读全文
posted @ 2019-08-08 00:07 北叶青藤 阅读(466) 评论(0) 推荐(0)
摘要:You are given a string with lower case letters only. Compress it by putting the count of the letter after it. If the letter appears once, Example: com 阅读全文
posted @ 2019-08-05 04:52 北叶青藤 阅读(279) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 ··· 12 下一页