05 2018 档案

摘要:[抄题]: In a given array nums of positive integers, find three non-overlapping subarrays with maximum sum. Each subarray will be of size k, and we want 阅读全文
posted @ 2018-05-28 22:02 苗妙苗 阅读(319) 评论(0) 推荐(0)
摘要:[抄题]: Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an 阅读全文
posted @ 2018-05-27 22:31 苗妙苗 阅读(339) 评论(0) 推荐(0)
摘要:[抄题]: There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of non-empt 阅读全文
posted @ 2018-05-26 09:53 苗妙苗 阅读(904) 评论(0) 推荐(0)
摘要:[抄题]: Given an array of words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) 阅读全文
posted @ 2018-05-25 17:19 苗妙苗 阅读(222) 评论(0) 推荐(0)
摘要:[抄题]: Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*'. The matching should cover the ent 阅读全文
posted @ 2018-05-24 10:08 苗妙苗 阅读(201) 评论(0) 推荐(0)
摘要:[抄题]: Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string ma 阅读全文
posted @ 2018-05-22 22:02 苗妙苗 阅读(422) 评论(0) 推荐(0)
摘要:[抄题]: Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffe 阅读全文
posted @ 2018-05-21 15:50 苗妙苗 阅读(188) 评论(0) 推荐(0)
摘要:[抄题]: Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1. Example 1: Example 2: Exa 阅读全文
posted @ 2018-05-20 21:39 苗妙苗 阅读(126) 评论(0) 推荐(0)
摘要:[抄题]: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. Example: [暴力解法]: 时间分析: 空间分 阅读全文
posted @ 2018-05-20 11:03 苗妙苗 阅读(343) 评论(0) 推荐(0)
摘要:[抄题]: Given a grid where each entry is only 0 or 1, find the number of corner rectangles. A corner rectangle is 4 distinct 1s on the grid that form an 阅读全文
posted @ 2018-05-19 22:05 苗妙苗 阅读(150) 评论(0) 推荐(0)
摘要:[抄题]: We have two integer sequences A and B of the same non-zero length. We are allowed to swap elements A[i] and B[i]. Note that both elements are in 阅读全文
posted @ 2018-05-18 11:30 苗妙苗 阅读(342) 评论(0) 推荐(0)
摘要:[抄题]: 求挖掉一些区域后,能允许出现的最大十字架 In a 2D grid from (0, 0) to (N-1, N-1), every cell contains a 1, except those cells in the given list mines which are 0. Wh 阅读全文
posted @ 2018-05-18 09:09 苗妙苗 阅读(180) 评论(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 t 阅读全文
posted @ 2018-05-17 11:22 苗妙苗 阅读(154) 评论(0) 推荐(0)
摘要:[抄题]: Some people will make friend requests. The list of their ages is given and ages[i] is the age of the ith person. Person A will NOT friend reques 阅读全文
posted @ 2018-05-17 10:38 苗妙苗 阅读(308) 评论(0) 推荐(0)
摘要:[抄题]: Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 阅读全文
posted @ 2018-05-16 23:42 苗妙苗 阅读(111) 评论(0) 推荐(0)
摘要:[抄题]: There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The bricks have the same height but different wid 阅读全文
posted @ 2018-05-16 16:59 苗妙苗 阅读(149) 评论(0) 推荐(0)
摘要:[抄题]: Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Example 2: [暴力解法]: 时间分析: 空间分析: [ 阅读全文
posted @ 2018-05-16 15:41 苗妙苗 阅读(134) 评论(0) 推荐(0)
摘要:[抄题]: Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target nu 阅读全文
posted @ 2018-05-16 11:13 苗妙苗 阅读(318) 评论(0) 推荐(0)
摘要:[抄题]: Given an unsorted array of integers, find the number of longest increasing subsequence. Example 1: Example 2: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空 阅读全文
posted @ 2018-05-15 22:22 苗妙苗 阅读(122) 评论(0) 推荐(0)
摘要:[抄题]: The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find the 阅读全文
posted @ 2018-05-15 11:41 苗妙苗 阅读(229) 评论(0) 推荐(0)
摘要:[抄题]: Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you coul 阅读全文
posted @ 2018-05-14 22:44 苗妙苗 阅读(272) 评论(0) 推荐(0)
摘要:[抄题]: You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should ch 阅读全文
posted @ 2018-05-14 21:45 苗妙苗 阅读(151) 评论(0) 推荐(0)
摘要:[抄题]: Given the running logs of n functions that are executed in a nonpreemptive single threaded CPU, find the exclusive time of these functions. Each 阅读全文
posted @ 2018-05-14 10:55 苗妙苗 阅读(112) 评论(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 fee re 阅读全文
posted @ 2018-05-13 22:43 苗妙苗 阅读(152) 评论(0) 推荐(0)
摘要:[抄题]: Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer t 阅读全文
posted @ 2018-05-13 15:12 苗妙苗 阅读(161) 评论(0) 推荐(0)
摘要:[抄题]: Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead. Note:The s 阅读全文
posted @ 2018-05-13 10:13 苗妙苗 阅读(250) 评论(0) 推荐(0)
摘要:[抄题]: Given an array of citations in ascending order (each citation is a non-negative integer) of a researcher, write a function to compute the resear 阅读全文
posted @ 2018-05-11 11:37 苗妙苗 阅读(164) 评论(0) 推荐(0)
摘要:[抄题]: Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. Acc 阅读全文
posted @ 2018-05-11 10:41 苗妙苗 阅读(150) 评论(0) 推荐(0)
摘要:[抄题]: Given a binary tree Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set t 阅读全文
posted @ 2018-05-10 17:17 苗妙苗 阅读(141) 评论(0) 推荐(0)
摘要:[抄题]: Design a data structure that supports all following operations in average O(1) time. Note: Duplicate elements are allowed. Example: [暴力解法]: 时间分析 阅读全文
posted @ 2018-05-10 09:52 苗妙苗 阅读(144) 评论(0) 推荐(0)
摘要:[抄题]: Design a data structure that supports all following operations in average O(1) time. Example: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩输出条件]: [ 阅读全文
posted @ 2018-05-09 16:58 苗妙苗 阅读(192) 评论(0) 推荐(0)
摘要:[抄题]: Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c" [暴力解法]: 时间 阅读全文
posted @ 2018-05-08 22:41 苗妙苗 阅读(140) 评论(0) 推荐(0)
摘要:[抄题]: Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conferenc 阅读全文
posted @ 2018-05-08 21:19 苗妙苗 阅读(157) 评论(0) 推荐(0)
摘要:[抄题]: A message containing letters from A-Z is being encoded to numbers using the following mapping: Given a non-empty string containing only digits, 阅读全文
posted @ 2018-05-08 15:04 苗妙苗 阅读(231) 评论(0) 推荐(0)
摘要:[抄题]: Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks.Tasks 阅读全文
posted @ 2018-05-08 10:52 苗妙苗 阅读(242) 评论(0) 推荐(0)
摘要:[抄题]: Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -- whose elements may also be 阅读全文
posted @ 2018-05-07 21:07 苗妙苗 阅读(145) 评论(0) 推荐(0)
摘要:[抄题]: Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes 阅读全文
posted @ 2018-05-07 16:10 苗妙苗 阅读(174) 评论(0) 推荐(0)
摘要:[抄题]: Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where 阅读全文
posted @ 2018-05-06 22:39 苗妙苗 阅读(308) 评论(0) 推荐(0)
摘要:[抄题]: Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. 阅读全文
posted @ 2018-05-06 16:14 苗妙苗 阅读(115) 评论(0) 推荐(0)
摘要:[抄题]: Given an array of strings, group anagrams together. Example: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩corner case]: [思维问题]: 不知道k-v怎么存 阅读全文
posted @ 2018-05-05 23:45 苗妙苗 阅读(282) 评论(0) 推荐(0)
摘要:[抄题]: mplement pow(x, n), which calculates x raised to the power n (xn). Example 1: Example 2: Example 3: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩输出 阅读全文
posted @ 2018-05-05 22:35 苗妙苗 阅读(208) 评论(0) 推荐(0)
摘要:[抄题]: Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums e 阅读全文
posted @ 2018-05-05 17:12 苗妙苗 阅读(141) 评论(0) 推荐(0)
摘要:[抄题]: Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. The matching should cover the e 阅读全文
posted @ 2018-05-05 09:15 苗妙苗 阅读(193) 评论(0) 推荐(0)
摘要:[抄题]: TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such a 阅读全文
posted @ 2018-05-04 21:08 苗妙苗 阅读(152) 评论(0) 推荐(0)
摘要:[抄题]: Reverse bits of a given 32 bits unsigned integer. Example: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩corner case]: [思维问题]: [一句话思路]: 32 阅读全文
posted @ 2018-05-04 11:38 苗妙苗 阅读(164) 评论(0) 推荐(0)
摘要:[抄题]: Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: Example 阅读全文
posted @ 2018-05-04 11:14 苗妙苗 阅读(238) 评论(0) 推荐(0)
摘要:[抄题]: Given an m * n matrix M initialized with all 0's and several update operations. Operations are represented by a 2D array, and each operation is 阅读全文
posted @ 2018-05-03 21:36 苗妙苗 阅读(154) 评论(0) 推荐(0)
摘要:[抄题]: We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself. Now, given an integer n, 阅读全文
posted @ 2018-05-03 17:06 苗妙苗 阅读(242) 评论(0) 推荐(0)
摘要:[抄题]: Given a non-negative integer c, your task is to decide whether there're two integers a and b such that a2 + b2 = c. Example 1: Example 2: [暴力解法] 阅读全文
posted @ 2018-05-03 16:23 苗妙苗 阅读(386) 评论(0) 推荐(0)
摘要:[抄题]: Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is increment 阅读全文
posted @ 2018-05-03 10:31 苗妙苗 阅读(138) 评论(0) 推荐(0)
摘要:[抄题]: A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0 阅读全文
posted @ 2018-05-03 09:17 苗妙苗 阅读(314) 评论(0) 推荐(0)
摘要:[抄题]: Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: Example 1: Example 2: Example 3: [暴力解法 阅读全文
posted @ 2018-05-01 22:05 苗妙苗 阅读(226) 评论(0) 推荐(0)
摘要:[抄题]: Given a column title as appear in an Excel sheet, return its corresponding column number. For example: Example 1: Example 2: Example 3: [暴力解法]: 阅读全文
posted @ 2018-05-01 17:04 苗妙苗 阅读(437) 评论(0) 推荐(0)
摘要:[抄题]: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is 阅读全文
posted @ 2018-05-01 16:08 苗妙苗 阅读(147) 评论(0) 推荐(0)
摘要:[抄题]: 将一个整数中的数字进行颠倒,当颠倒后的整数溢出时,返回 0 (标记为 32 位整数)。 将一个整数中的数字进行颠倒,当颠倒后的整数溢出时,返回 0 (标记为 32 位整数)。 将一个整数中的数字进行颠倒,当颠倒后的整数溢出时,返回 0 (标记为 32 位整数)。 样例 给定 x = 12 阅读全文
posted @ 2018-05-01 11:33 苗妙苗 阅读(143) 评论(0) 推荐(0)
摘要:[抄题]: Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Example 2: Examp 阅读全文
posted @ 2018-05-01 10:18 苗妙苗 阅读(114) 评论(0) 推荐(0)