03 2019 档案

摘要:题目如下: Equations are given in the format A / B = k, whereA and B are variables represented as strings, and k is a real number (floating point number). 阅读全文
posted @ 2019-03-31 16:56 seyjs 阅读(111) 评论(0) 推荐(0)
摘要:题目如下: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balance 阅读全文
posted @ 2019-03-30 09:22 seyjs 阅读(241) 评论(0) 推荐(0)
摘要:题目如下: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tre 阅读全文
posted @ 2019-03-30 09:16 seyjs 阅读(182) 评论(0) 推荐(0)
摘要:题目如下: Given a positive integer K, you need find the smallest positive integer N such that N is divisible by K, and N only contains the digit 1. Return 阅读全文
posted @ 2019-03-27 21:49 seyjs 阅读(315) 评论(0) 推荐(0)
摘要:题目如下: A character is unique in string S if it occurs exactly once in it. For example, in string S = "LETTER", the only unique characters are "L" and " 阅读全文
posted @ 2019-03-26 19:44 seyjs 阅读(531) 评论(0) 推荐(0)
摘要:题目如下: Given a binary string S (a string consisting only of '0' and '1's) and a positive integer N, return true if and only if for every integer X from 阅读全文
posted @ 2019-03-26 10:00 seyjs 阅读(282) 评论(0) 推荐(0)
摘要:题目如下: Given an array A of positive integers, A[i]represents the value of the i-th sightseeing spot, and two sightseeing spots i and j have distance j 阅读全文
posted @ 2019-03-26 09:56 seyjs 阅读(411) 评论(0) 推荐(0)
摘要:题目如下: Given an array A of integers, return true if and only if we can partition the array into three non-emptyparts with equal sums. Formally, we can 阅读全文
posted @ 2019-03-26 09:40 seyjs 阅读(292) 评论(0) 推荐(0)
摘要:题目如下: Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of  阅读全文
posted @ 2019-03-23 21:55 seyjs 阅读(218) 评论(0) 推荐(0)
摘要:题目如下: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may 阅读全文
posted @ 2019-03-22 15:20 seyjs 阅读(118) 评论(0) 推荐(0)
摘要:题目如下: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may 阅读全文
posted @ 2019-03-22 14:27 seyjs 阅读(179) 评论(0) 推荐(0)
摘要:题目如下: Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer feerep 阅读全文
posted @ 2019-03-22 11:24 seyjs 阅读(207) 评论(0) 推荐(0)
摘要:题目如下: Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look like this: "...zabcdefghijklmnopqrstu 阅读全文
posted @ 2019-03-21 22:29 seyjs 阅读(275) 评论(0) 推荐(0)
摘要:题目如下: Given an array of unique integers, each integer is strictly greater than 1. We make a binary tree using these integers and each number may be us 阅读全文
posted @ 2019-03-20 16:28 seyjs 阅读(237) 评论(0) 推荐(0)
摘要:题目如下: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You may not modify the values in the list's nodes, only nod 阅读全文
posted @ 2019-03-19 17:13 seyjs 阅读(220) 评论(0) 推荐(0)
摘要:题目如下: A conveyor belt has packages that must be shipped from one port to another within D days. The i-th package on the conveyor belt has a weight of  阅读全文
posted @ 2019-03-19 17:09 seyjs 阅读(378) 评论(0) 推荐(0)
摘要:题目如下: In a list of songs, the i-th song has a duration of time[i] seconds. Return the number of pairs of songs for which their total duration in secon 阅读全文
posted @ 2019-03-19 17:00 seyjs 阅读(374) 评论(0) 推荐(0)
摘要:题目如下: Every non-negative integer N has a binary representation. For example, 5 can be represented as "101" in binary, 11 as "1011" in binary, and so o 阅读全文
posted @ 2019-03-19 16:54 seyjs 阅读(349) 评论(0) 推荐(0)
摘要:题目如下: Given a non-empty binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node t 阅读全文
posted @ 2019-03-18 22:41 seyjs 阅读(114) 评论(0) 推荐(0)
摘要:题目如下: Sort a linked list in O(n log n) time using constant space complexity. Example 1: Example 2: 解题思路:因为题目要求时间复杂度是O(nlogn),所以快排应该是合适的方法。原理也和快速排序差不多, 阅读全文
posted @ 2019-03-18 16:21 seyjs 阅读(127) 评论(0) 推荐(0)
摘要:题目如下: Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups 阅读全文
posted @ 2019-03-15 16:37 seyjs 阅读(158) 评论(0) 推荐(0)
摘要:题目如下: Return the root node of a binary search tree that matches the given preorder traversal. (Recall that a binary search tree is a binary tree where 阅读全文
posted @ 2019-03-14 22:32 seyjs 阅读(353) 评论(0) 推荐(0)
摘要:题目如下: Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with value v at the given depth d. The root node is at 阅读全文
posted @ 2019-03-13 17:23 seyjs 阅读(213) 评论(0) 推荐(0)
摘要:题目如下: The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid ou 阅读全文
posted @ 2019-03-11 10:20 seyjs 阅读(206) 评论(0) 推荐(0)
摘要:题目如下: Given a list of words (without duplicates), please write a program that returns all concatenated words in the given list of words. A concatenate 阅读全文
posted @ 2019-03-11 10:06 seyjs 阅读(291) 评论(0) 推荐(0)
摘要:题目如下: In a row of dominoes, A[i] and B[i] represent the top and bottom halves of the i-th domino. (A domino is a tile with two numbers from 1 to 6 - o 阅读全文
posted @ 2019-03-11 09:59 seyjs 阅读(701) 评论(0) 推荐(0)
摘要:题目如下: Normally, the factorial of a positive integer n is the product of all positive integers less than or equal to n. For example, factorial(10) = 10 阅读全文
posted @ 2019-03-11 09:51 seyjs 阅读(380) 评论(0) 推荐(0)
摘要:题目如下: Given an array A of integers, we must modify the array in the following way: we choose an i and replace A[i]with -A[i], and we repeat this proce 阅读全文
posted @ 2019-03-11 09:46 seyjs 阅读(273) 评论(0) 推荐(0)
摘要:题目如下: Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sur 阅读全文
posted @ 2019-03-08 15:20 seyjs 阅读(152) 评论(0) 推荐(0)
摘要:题目如下: Given a non-empty string containing an out-of-order English representation of digits 0-9, output the digits in ascending order. Note: Example 1: 阅读全文
posted @ 2019-03-08 14:00 seyjs 阅读(203) 评论(0) 推荐(0)
摘要:题目如下: Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping. Note 阅读全文
posted @ 2019-03-08 11:10 seyjs 阅读(156) 评论(0) 推荐(0)
摘要:题目如下: Given a string that consists of only uppercase English letters, you can replace any letter in the string with another letter at most k times. Fi 阅读全文
posted @ 2019-03-08 11:06 seyjs 阅读(189) 评论(0) 推荐(0)
摘要:题目如下: You are given the number of rows n_rows and number of columns n_cols of a 2D binary matrix where all values are initially 0. Write a function fl 阅读全文
posted @ 2019-03-07 13:55 seyjs 阅读(230) 评论(0) 推荐(0)
摘要:题目如下: In an array A containing only 0s and 1s, a K-bit flip consists of choosing a (contiguous) subarray of length K and simultaneously changing every 阅读全文
posted @ 2019-03-05 15:12 seyjs 阅读(245) 评论(0) 推荐(0)
摘要:题目如下: On a N x N grid of cells, each cell (x, y) with 0 <= x < N and 0 <= y < N has a lamp. Initially, some number of lamps are on. lamps[i] tells us 阅读全文
posted @ 2019-03-05 09:47 seyjs 阅读(261) 评论(0) 推荐(0)
摘要:题目如下: Given an array A of strings made only from lowercase letters, return a list of all characters that show up in all strings within the list (inclu 阅读全文
posted @ 2019-03-04 10:33 seyjs 阅读(624) 评论(0) 推荐(0)
摘要:题目如下: We are given that the string "abc" is valid. From any valid string V, we may split V into two pieces X and Y such that X + Y (X concatenated wit 阅读全文
posted @ 2019-03-04 10:26 seyjs 阅读(303) 评论(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 on 阅读全文
posted @ 2019-03-04 10:21 seyjs 阅读(478) 评论(0) 推荐(0)
摘要:题目如下: There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for example to take course 0 you ha 阅读全文
posted @ 2019-03-01 14:41 seyjs 阅读(205) 评论(0) 推荐(0)