07 2020 档案

摘要:You are given two integer arrays nums1 and nums2 sorted in non-decreasing order and an integer k. Define a pair (u, v) which consists of one element f 阅读全文
posted @ 2020-07-31 13:44 CNoodle 阅读(284) 评论(0) 推荐(0)
摘要:Given the root of a binary tree and an integer targetSum, return the number of paths where the sum of the values along the path equals targetSum. The 阅读全文
posted @ 2020-07-30 07:11 CNoodle 阅读(224) 评论(0) 推荐(0)
摘要:Given an integer n, break it into the sum of k positive integers, where k >= 2, and maximize the product of those integers. Return the maximum product 阅读全文
posted @ 2020-07-30 02:51 CNoodle 阅读(185) 评论(0) 推荐(0)
摘要:There is a ball in a maze with empty spaces (represented as 0) and walls (represented as 1). The ball can go through the empty spaces by rolling up, d 阅读全文
posted @ 2020-07-28 14:41 CNoodle 阅读(334) 评论(0) 推荐(0)
摘要:There is a ball in a maze with empty spaces (represented as 0) and walls (represented as 1). The ball can go through the empty spaces by rolling up, d 阅读全文
posted @ 2020-07-28 05:32 CNoodle 阅读(228) 评论(0) 推荐(0)
摘要:There is a ball in a maze with empty spaces (represented as 0) and walls (represented as 1). The ball can go through the empty spaces by rolling up, d 阅读全文
posted @ 2020-07-28 02:06 CNoodle 阅读(445) 评论(0) 推荐(0)
摘要:We distribute some number of candies, to a row of n = num_people people in the following way: We then give 1 candy to the first person, 2 candies to t 阅读全文
posted @ 2020-07-25 07:15 CNoodle 阅读(275) 评论(0) 推荐(0)
摘要:Given the edges of a directed graph, and two nodes source and destination of this graph, determine whether or not all paths starting from source event 阅读全文
posted @ 2020-07-25 04:26 CNoodle 阅读(764) 评论(0) 推荐(0)
摘要:Given a directed acyclic graph (DAG) of n nodes labeled from 0 to n - 1, find all possible paths from node 0 to node n - 1, and return them in any ord 阅读全文
posted @ 2020-07-25 01:15 CNoodle 阅读(303) 评论(0) 推荐(0)
摘要:Given a list of 24-hour clock time points in "Hour:Minutes" format, find the minimum minutes difference between any two time points in the list. Examp 阅读全文
posted @ 2020-07-24 05:49 CNoodle 阅读(173) 评论(0) 推荐(0)
摘要:Let's play the minesweeper game (Wikipedia, online game)! You are given an m x n char matrix board representing the game board where: 'M' represents a 阅读全文
posted @ 2020-07-23 12:14 CNoodle 阅读(286) 评论(0) 推荐(0)
摘要:You are controlling a robot that is located somewhere in a room. The room is modeled as an m x n binary grid where 0 represents a wall and 1 represent 阅读全文
posted @ 2020-07-23 07:18 CNoodle 阅读(473) 评论(0) 推荐(0)
摘要:There is an m x n rectangular island that borders both the Pacific Ocean and Atlantic Ocean. The Pacific Ocean touches the island's left and top edges 阅读全文
posted @ 2020-07-23 05:33 CNoodle 阅读(296) 评论(0) 推荐(0)
摘要:Given an m x n integers matrix, return the length of the longest increasing path in matrix. From each cell, you can either move in four directions: le 阅读全文
posted @ 2020-07-22 15:45 CNoodle 阅读(356) 评论(0) 推荐(0)
摘要:Given a string s, return the number of substrings that have only one distinct letter. Example 1: Input: s = "aaaba" Output: 8 Explanation: The substri 阅读全文
posted @ 2020-07-20 13:50 CNoodle 阅读(608) 评论(0) 推荐(0)
摘要:Given a string s and an integer k, return the number of substrings in s of length k with no repeated characters. Example 1: Input: s = "havefunonleetc 阅读全文
posted @ 2020-07-20 05:29 CNoodle 阅读(259) 评论(0) 推荐(0)
摘要:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloon 阅读全文
posted @ 2020-07-19 13:33 CNoodle 阅读(190) 评论(0) 推荐(0)
摘要:Given an unsorted array of integers nums, return the length of the longest continuous increasing subsequence (i.e. subarray). The subsequence must be  阅读全文
posted @ 2020-07-18 17:44 CNoodle 阅读(173) 评论(0) 推荐(0)
摘要:Given an integer array nums and an integer k, return the maximum length of a subarray that sums to k. If there is not one, return 0 instead. Example 1 阅读全文
posted @ 2020-07-18 05:10 CNoodle 阅读(288) 评论(0) 推荐(0)
摘要:You are visiting a farm that has a single row of fruit trees arranged from left to right. The trees are represented by an integer array fruits where f 阅读全文
posted @ 2020-07-18 03:01 CNoodle 阅读(177) 评论(0) 推荐(0)
摘要:Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right 阅读全文
posted @ 2020-07-17 05:43 CNoodle 阅读(488) 评论(0) 推荐(0)
摘要:A valid number can be split up into these components (in order): A decimal number or an integer. (Optional) An 'e' or 'E', followed by an integer. A d 阅读全文
posted @ 2020-07-16 12:57 CNoodle 阅读(520) 评论(0) 推荐(0)
摘要:There is an undirected graph with n nodes, where each node is numbered between 0 and n - 1. You are given a 2D array graph, where graph[u] is an array 阅读全文
posted @ 2020-07-16 02:03 CNoodle 阅读(272) 评论(0) 推荐(0)
摘要:Given two numbers, hour and minutes. Return the smaller angle (in degrees) formed between the hour and the minute hand. Example 1: Input: hour = 12, m 阅读全文
posted @ 2020-07-15 08:33 CNoodle 阅读(358) 评论(0) 推荐(0)
摘要:Given a binary string s, return the number of substrings with all characters 1's. Since the answer may be too large, return it modulo 109 + 7. Example 阅读全文
posted @ 2020-07-13 08:03 CNoodle 阅读(324) 评论(0) 推荐(0)
摘要:Given an array of integers nums, return the number of good pairs. A pair (i, j) is called good if nums[i] == nums[j] and i < j. Example 1: Input: nums 阅读全文
posted @ 2020-07-13 04:33 CNoodle 阅读(811) 评论(0) 推荐(0)
摘要:Given a binary tree struct Node { int val; Node *left; Node *right; Node *next; } Populate each next pointer to point to its next right node. If there 阅读全文
posted @ 2020-07-12 14:38 CNoodle 阅读(623) 评论(0) 推荐(0)
摘要:You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following defin 阅读全文
posted @ 2020-07-12 08:07 CNoodle 阅读(497) 评论(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 out in a 阅读全文
posted @ 2020-07-12 05:48 CNoodle 阅读(262) 评论(0) 推荐(0)
摘要:Given a string expression of numbers and operators, return all possible results from computing all the different possible ways to group numbers and op 阅读全文
posted @ 2020-07-11 11:11 CNoodle 阅读(218) 评论(0) 推荐(0)
摘要:Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the num 阅读全文
posted @ 2020-07-11 07:06 CNoodle 阅读(457) 评论(0) 推荐(0)
摘要:You are given a doubly linked list, which contains nodes that have a next pointer, a previous pointer, and an additional child pointer. This child poi 阅读全文
posted @ 2020-07-11 01:58 CNoodle 阅读(255) 评论(0) 推荐(0)
摘要:You are given a string s. We want to partition the string into as many parts as possible so that each letter appears in at most one part. Note that th 阅读全文
posted @ 2020-07-10 12:17 CNoodle 阅读(207) 评论(0) 推荐(0)
摘要:Given the root of a binary tree, return the maximum width of the given tree. The maximum width of a tree is the maximum width among all levels. The wi 阅读全文
posted @ 2020-07-10 06:15 CNoodle 阅读(189) 评论(0) 推荐(0)
摘要:Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be 阅读全文
posted @ 2020-07-10 02:15 CNoodle 阅读(199) 评论(0) 推荐(0)
摘要:Given a string s, you can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible str 阅读全文
posted @ 2020-07-10 00:53 CNoodle 阅读(265) 评论(0) 推荐(0)
摘要:Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. A palindro 阅读全文
posted @ 2020-07-09 07:39 CNoodle 阅读(602) 评论(0) 推荐(0)
摘要:Numbers can be regarded as product of its factors. For example, 8 = 2 x 2 x 2; = 2 x 4. Write a function that takes an integer n and return all possib 阅读全文
posted @ 2020-07-09 05:20 CNoodle 阅读(274) 评论(0) 推荐(0)
摘要:你正在使用一堆木板建造跳水板。有两种类型的木板,其中长度较短的木板长度为shorter,长度较长的木板长度为longer。你必须正好使用k块木板。编写一个方法,生成跳水板所有可能的长度。 返回的长度需要从小到大排列。 示例: 输入:shorter = 1longer = 2k = 3输出: {3,4 阅读全文
posted @ 2020-07-08 01:07 CNoodle 阅读(264) 评论(0) 推荐(0)
摘要:The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calcul 阅读全文
posted @ 2020-07-06 06:22 CNoodle 阅读(301) 评论(0) 推荐(0)
摘要:We have a wooden plank of the length n units. Some ants are walking on the plank, each ant moves with speed 1 unit per second. Some of the ants move t 阅读全文
posted @ 2020-07-05 12:34 CNoodle 阅读(232) 评论(0) 推荐(0)
摘要:Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list 阅读全文
posted @ 2020-07-05 07:43 CNoodle 阅读(458) 评论(0) 推荐(0)
摘要:The count-and-say sequence is a sequence of digit strings defined by the recursive formula: countAndSay(1) = "1" countAndSay(n) is the way you would " 阅读全文
posted @ 2020-07-04 15:00 CNoodle 阅读(558) 评论(0) 推荐(0)
摘要:There are 8 prison cells in a row, and each cell is either occupied or vacant. Each day, whether the cell is occupied or vacant changes according to t 阅读全文
posted @ 2020-07-04 06:20 CNoodle 阅读(327) 评论(0) 推荐(0)
摘要:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. Example 1: Input: 阅读全文
posted @ 2020-07-04 04:07 CNoodle 阅读(467) 评论(0) 推荐(0)
摘要:Given a triangle array, return the minimum path sum from top to bottom. For each step, you may move to an adjacent number of the row below. More forma 阅读全文
posted @ 2020-07-03 14:36 CNoodle 阅读(563) 评论(0) 推荐(0)
摘要:You have n coins and you want to build a staircase with these coins. The staircase consists of k rows where the ith row has exactly i coins. The last 阅读全文
posted @ 2020-07-02 03:17 CNoodle 阅读(225) 评论(0) 推荐(0)
摘要:Given an m x n grid of characters board and a string word, return true if word exists in the grid. The word can be constructed from letters of sequent 阅读全文
posted @ 2020-07-01 06:07 CNoodle 阅读(526) 评论(0) 推荐(0)
摘要:Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0. A subsequence o 阅读全文
posted @ 2020-07-01 03:55 CNoodle 阅读(261) 评论(0) 推荐(0)
摘要:Given two integer arrays nums1 and nums2, return the maximum length of a subarray that appears in both arrays. Example 1: Input: nums1 = [1,2,3,2,1], 阅读全文
posted @ 2020-07-01 03:20 CNoodle 阅读(203) 评论(0) 推荐(0)