上一页 1 2 3 4 5 6 7 8 ··· 46 下一页
  2018年3月11日
摘要: Given a directed, acyclic graph of N nodes. Find all possible paths from node 0 to node N 1, and return them in any order. The graph is given as follo 阅读全文
posted @ 2018-03-11 20:36 Beserious 阅读(376) 评论(0) 推荐(0) 编辑
摘要: We are given two strings, A and B. A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, 阅读全文
posted @ 2018-03-11 20:20 Beserious 阅读(283) 评论(0) 推荐(0) 编辑
  2018年3月10日
摘要: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find 阅读全文
posted @ 2018-03-10 21:32 Beserious 阅读(142) 评论(0) 推荐(0) 编辑
  2018年3月9日
摘要: We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign r 阅读全文
posted @ 2018-03-09 20:13 Beserious 阅读(173) 评论(0) 推荐(0) 编辑
  2018年3月8日
摘要: We are given an array A of positive integers, and two positive integers L and R (L R`的数字,那么此时就重新开始计数。思路很简单,但是实现起来..... 代码中b维护的是`& A, int L, int R) { i 阅读全文
posted @ 2018-03-08 18:57 Beserious 阅读(319) 评论(0) 推荐(0) 编辑
  2018年3月6日
摘要: Given string S and a dictionary of words words, find the number of words[i] that is a subsequence of S. 思路:先用vector记录每个字母出现的位置,然后遍历每个单词,如果每个字母的位置是递增的那 阅读全文
posted @ 2018-03-06 21:58 Beserious 阅读(341) 评论(0) 推荐(0) 编辑
  2018年3月1日
摘要: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh 阅读全文
posted @ 2018-03-01 21:30 Beserious 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: 阅读全文
posted @ 2018-03-01 11:20 Beserious 阅读(87) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. 还是bst树,bst树的左节点小于根节点小于右节点,依据此性质递归比较既可以找到公共父节点。注 阅读全文
posted @ 2018-03-01 10:36 Beserious 阅读(79) 评论(0) 推荐(0) 编辑
摘要: Given a non empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may a 阅读全文
posted @ 2018-03-01 10:32 Beserious 阅读(94) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 46 下一页