04 2021 档案

摘要:Design a Leaderboard class, which has 3 functions: addScore(playerId, score): Update the leaderboard by adding score to the given player's score. If t 阅读全文
posted @ 2021-04-27 06:32 CNoodle 阅读(704) 评论(0) 推荐(0)
摘要:You want to build n new buildings in a city. The new buildings will be built in a line and are labeled from 1 to n. However, there are city restrictio 阅读全文
posted @ 2021-04-27 00:20 CNoodle 阅读(146) 评论(0) 推荐(0)
摘要:A string is considered beautiful if it satisfies the following conditions: Each of the 5 English vowels ('a', 'e', 'i', 'o', 'u') must appear at least 阅读全文
posted @ 2021-04-26 05:21 CNoodle 阅读(295) 评论(0) 推荐(0)
摘要:The frequency of an element is the number of times it occurs in an array. You are given an integer array nums and an integer k. In one operation, you 阅读全文
posted @ 2021-04-26 04:54 CNoodle 阅读(373) 评论(0) 推荐(0)
摘要:Given an integer n (in base 10) and a base k, return the sum of the digits of n after converting n from base 10 to base k. After converting, each digi 阅读全文
posted @ 2021-04-25 15:10 CNoodle 阅读(198) 评论(0) 推荐(0)
摘要:Given an array nums which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an 阅读全文
posted @ 2021-04-25 01:29 CNoodle 阅读(165) 评论(0) 推荐(0)
摘要:In an infinite binary tree where every node has two children, the nodes are labelled in row order. In the odd numbered rows (ie., the first, third, fi 阅读全文
posted @ 2021-04-23 14:57 CNoodle 阅读(80) 评论(0) 推荐(0)
摘要:On the first row, we write a 0. Now in every subsequent row, we look at the previous row and replace each occurrence of 0 with 01, and each occurrence 阅读全文
posted @ 2021-04-22 23:50 CNoodle 阅读(187) 评论(0) 推荐(0)
摘要:Imagine you have a special keyboard with the following keys: Key 1: (A): Print one 'A' on screen. Key 2: (Ctrl-A): Select the whole screen. Key 3: (Ct 阅读全文
posted @ 2021-04-18 05:07 CNoodle 阅读(263) 评论(0) 推荐(0)
摘要:Design a queue that supports push and pop operations in the front, middle, and back. Implement the FrontMiddleBack class: FrontMiddleBack() Initialize 阅读全文
posted @ 2021-04-18 02:15 CNoodle 阅读(188) 评论(0) 推荐(0)
摘要:Given the root of a binary tree, consider all root to leaf paths: paths from the root to any leaf. (A leaf is a node with no children.) A node is insu 阅读全文
posted @ 2021-04-15 01:21 CNoodle 阅读(93) 评论(0) 推荐(0)
摘要:Given the root of a binary tree, return the sum of values of its deepest leaves. Example 1: Input: root = [1,2,3,4,5,null,6,7,null,null,null,null,8] O 阅读全文
posted @ 2021-04-13 12:30 CNoodle 阅读(277) 评论(0) 推荐(0)
摘要:You are given a string s of even length. Split this string into two halves of equal lengths, and let a be the first half and b be the second half. Two 阅读全文
posted @ 2021-04-08 13:29 CNoodle 阅读(153) 评论(0) 推荐(0)
摘要:You are given an integer array nums of length n which represents a permutation of all the integers in the range [0, n - 1]. The number of global inver 阅读全文
posted @ 2021-04-05 23:13 CNoodle 阅读(118) 评论(0) 推荐(0)
摘要:You have d dice, and each die has f faces numbered 1, 2, ..., f. Return the number of possible ways (out of fd total ways) modulo 10^9 + 7 to roll the 阅读全文
posted @ 2021-04-05 13:48 CNoodle 阅读(232) 评论(0) 推荐(0)
摘要:In a forest, each rabbit has some color. Some subset of rabbits (possibly all of them) tell you how many other rabbits have the same color as them. Th 阅读全文
posted @ 2021-04-04 08:56 CNoodle 阅读(197) 评论(0) 推荐(0)
摘要:A matrix diagonal is a diagonal line of cells starting from some cell in either the topmost row or leftmost column and going in the bottom-right direc 阅读全文
posted @ 2021-04-04 06:55 CNoodle 阅读(396) 评论(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 * 9 * 阅读全文
posted @ 2021-04-04 06:07 CNoodle 阅读(151) 评论(0) 推荐(0)
摘要:Given an array arr that is a permutation of [0, 1, ..., arr.length - 1], we split the array into some number of "chunks" (partitions), and individuall 阅读全文
posted @ 2021-04-04 05:28 CNoodle 阅读(96) 评论(0) 推荐(0)
摘要:Given the root of a binary tree, return the sum of every tree node's tilt. The tilt of a tree node is the absolute difference between the sum of all l 阅读全文
posted @ 2021-04-04 04:55 CNoodle 阅读(100) 评论(0) 推荐(0)
摘要:You are given three positive integers: n, index, and maxSum. You want to construct an array nums (0-indexed) that satisfies the following conditions: 阅读全文
posted @ 2021-04-01 05:22 CNoodle 阅读(414) 评论(0) 推荐(0)