11 2020 档案

摘要:You are given a list of songs where the ith song has a duration of time[i] seconds. Return the number of pairs of songs for which their total duration 阅读全文
posted @ 2020-11-28 05:05 CNoodle 阅读(128) 评论(0) 推荐(0)
摘要:Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is grea 阅读全文
posted @ 2020-11-27 17:19 CNoodle 阅读(421) 评论(0) 推荐(0)
摘要:Given an array of unique integers, arr, where each integer arr[i] is strictly greater than 1. We make a binary tree using these integers, and each num 阅读全文
posted @ 2020-11-26 07:33 CNoodle 阅读(290) 评论(0) 推荐(0)
摘要:Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, '+', '-', '*', '/' ope 阅读全文
posted @ 2020-11-26 02:23 CNoodle 阅读(365) 评论(0) 推荐(0)
摘要:Given the binary representation of an integer as a string s, return the number of steps to reduce it to 1 under the following rules: If the current nu 阅读全文
posted @ 2020-11-23 17:23 CNoodle 阅读(396) 评论(0) 推荐(0)
摘要:Given a binary tree root and a linked list with head as the first node. Return True if all the elements in the linked list starting from the head corr 阅读全文
posted @ 2020-11-23 07:00 CNoodle 阅读(414) 评论(0) 推荐(0)
摘要:Given two strings: s1 and s2 with the same size, check if some permutation of string s1 can break some permutation of string s2 or vice-versa. In othe 阅读全文
posted @ 2020-11-21 00:59 CNoodle 阅读(184) 评论(0) 推荐(0)
摘要:Given the head of a singly linked list and an integer k, split the linked list into k consecutive linked list parts. The length of each part should be 阅读全文
posted @ 2020-11-19 01:08 CNoodle 阅读(200) 评论(0) 推荐(0)
摘要:There is a special square room with mirrors on each of the four walls. Except for the southwest corner, there are receptors on each of the remaining c 阅读全文
posted @ 2020-11-18 03:42 CNoodle 阅读(172) 评论(0) 推荐(0)
摘要:We are given a matrix with R rows and C columns has cells with integer coordinates (r, c), where 0 <= r < R and 0 <= c < C. Additionally, we are given 阅读全文
posted @ 2020-11-17 15:44 CNoodle 阅读(192) 评论(0) 推荐(0)
摘要:Given an array nums of integers, return the length of the longest arithmetic subsequence in nums. Note that: A subsequence is an array that can be der 阅读全文
posted @ 2020-11-14 09:49 CNoodle 阅读(337) 评论(0) 推荐(0)
摘要:Given an m x n binary matrix mat, return the number of special positions in mat. A position (i, j) is called special if mat[i][j] == 1 and all other e 阅读全文
posted @ 2020-11-14 00:58 CNoodle 阅读(355) 评论(0) 推荐(0)
摘要:Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empty list if no palindromic permutation could be form 阅读全文
posted @ 2020-11-13 12:11 CNoodle 阅读(242) 评论(0) 推荐(0)
摘要:Given an array of integers nums, half of the integers in nums are odd, and the other half are even. Sort the array so that whenever nums[i] is odd, i  阅读全文
posted @ 2020-11-12 02:59 CNoodle 阅读(156) 评论(0) 推荐(0)
摘要:Given the coordinates of four points in 2D space p1, p2, p3 and p4, return true if the four points construct a square. The coordinate of a point pi is 阅读全文
posted @ 2020-11-12 02:10 CNoodle 阅读(234) 评论(0) 推荐(0)
摘要:You are given an n x n binary matrix grid where 1 represents land and 0 represents water. An island is a 4-directionally connected group of 1's not co 阅读全文
posted @ 2020-11-12 01:22 CNoodle 阅读(287) 评论(0) 推荐(0)
摘要:You are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you can either climb one or two steps 阅读全文
posted @ 2020-11-10 02:24 CNoodle 阅读(138) 评论(0) 推荐(0)
摘要:Given the root of a binary tree, find the maximum value v for which there exist different nodes a and b where v = |a.val - b.val| and a is an ancestor 阅读全文
posted @ 2020-11-10 01:08 CNoodle 阅读(204) 评论(0) 推荐(0)
摘要:On an NxN chessboard, a knight starts at the r-th row and c-th column and attempts to make exactly K moves. The rows and columns are 0 indexed, so the 阅读全文
posted @ 2020-11-09 02:28 CNoodle 阅读(331) 评论(0) 推荐(0)
摘要:A polynomial linked list is a special type of linked list where every node represents a term in a polynomial expression. Each node has three attribute 阅读全文
posted @ 2020-11-08 03:50 CNoodle 阅读(648) 评论(0) 推荐(0)
摘要:Given an array of integers nums and an integer threshold, we will choose a positive integer divisor, divide all the array by it, and sum the division' 阅读全文
posted @ 2020-11-07 13:43 CNoodle 阅读(250) 评论(0) 推荐(0)
摘要:Given an integer array arr. You have to sort the integers in the array in ascending order by the number of 1's in their binary representation and in c 阅读全文
posted @ 2020-11-06 01:49 CNoodle 阅读(628) 评论(0) 推荐(0)
摘要:A tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected graph without simple cycles i 阅读全文
posted @ 2020-11-05 02:12 CNoodle 阅读(670) 评论(0) 推荐(0)
摘要:Given a C++ program, remove comments from it. The program source is an array where source[i] is the i-th line of the source code. This represents the 阅读全文
posted @ 2020-11-04 05:49 CNoodle 阅读(237) 评论(0) 推荐(0)
摘要:这三道题差别不是非常大所以可以放在一起练习。 243. Shortest Word Distance Given a list of words and two words word1 and word2, return the shortest distance between these two 阅读全文
posted @ 2020-11-04 03:40 CNoodle 阅读(319) 评论(0) 推荐(0)
摘要:Given a set of points in the xy-plane, determine the minimum area of a rectangle formed from these points, with sides parallel to the x and y axes. If 阅读全文
posted @ 2020-11-04 02:01 CNoodle 阅读(188) 评论(0) 推荐(0)
摘要:There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following re 阅读全文
posted @ 2020-11-03 13:59 CNoodle 阅读(491) 评论(0) 推荐(0)
摘要:There are n soldiers standing in a line. Each soldier is assigned a unique rating value. You have to form a team of 3 soldiers amongst them under the 阅读全文
posted @ 2020-11-03 13:04 CNoodle 阅读(434) 评论(0) 推荐(0)
摘要:Given an integer array nums, return the number of longest increasing subsequences. Example 1: Input: nums = [1,3,5,4,7] Output: 2 Explanation: The two 阅读全文
posted @ 2020-11-02 07:36 CNoodle 阅读(227) 评论(0) 推荐(0)