上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 64 下一页
摘要: 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 阅读(322) 评论(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 阅读(808) 评论(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 阅读(622) 评论(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 阅读(253) 评论(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 阅读(206) 评论(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 阅读(197) 评论(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 阅读(264) 评论(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 阅读(601) 评论(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 阅读(272) 评论(0) 推荐(0)
摘要: 你正在使用一堆木板建造跳水板。有两种类型的木板,其中长度较短的木板长度为shorter,长度较长的木板长度为longer。你必须正好使用k块木板。编写一个方法,生成跳水板所有可能的长度。 返回的长度需要从小到大排列。 示例: 输入:shorter = 1longer = 2k = 3输出: {3,4 阅读全文
posted @ 2020-07-08 01:07 CNoodle 阅读(262) 评论(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 阅读(299) 评论(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 阅读(557) 评论(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 阅读(326) 评论(0) 推荐(0)
上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 64 下一页