10 2020 档案

摘要:Given an array of integers nums, calculate the pivot index of this array. The pivot index is the index where the sum of all the numbers strictly to th 阅读全文
posted @ 2020-10-30 10:15 CNoodle 阅读(168) 评论(0) 推荐(0)
摘要:In a gold mine grid of size m * n, each cell in this mine has an integer representing the amount of gold in that cell, 0 if it is empty. Return the ma 阅读全文
posted @ 2020-10-30 08:35 CNoodle 阅读(317) 评论(0) 推荐(0)
摘要:You are given an array representing a row of seats where seats[i] = 1 represents a person sitting in the ith seat, and seats[i] = 0 represents that th 阅读全文
posted @ 2020-10-30 00:53 CNoodle 阅读(196) 评论(0) 推荐(0)
摘要:Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other wo 阅读全文
posted @ 2020-10-29 14:24 CNoodle 阅读(280) 评论(0) 推荐(0)
摘要:Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. 阅读全文
posted @ 2020-10-29 05:11 CNoodle 阅读(241) 评论(0) 推荐(0)
摘要:Given a string s, return the last substring of s in lexicographical order. Example 1: Input: "abab" Output: "bab" Explanation: The substrings are ["a" 阅读全文
posted @ 2020-10-29 01:46 CNoodle 阅读(284) 评论(0) 推荐(0)
摘要:A move consists of taking a point (x, y) and transforming it to either (x, x+y) or (x+y, y). Given a starting point (sx, sy) and a target point (tx, t 阅读全文
posted @ 2020-10-28 05:12 CNoodle 阅读(101) 评论(0) 推荐(0)
摘要:A school is trying to take an annual photo of all the students. The students are asked to stand in a single file line in non-decreasing order by heigh 阅读全文
posted @ 2020-10-28 03:13 CNoodle 阅读(166) 评论(0) 推荐(0)
摘要:We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so on until the 100th row. Each glass holds one cup  阅读全文
posted @ 2020-10-28 01:15 CNoodle 阅读(275) 评论(0) 推荐(0)
摘要:Alice and Bob take turns playing a game, with Alice starting first. Initially, there are n stones in a pile. On each player's turn, that player makes 阅读全文
posted @ 2020-10-26 05:05 CNoodle 阅读(436) 评论(0) 推荐(0)
摘要:You start with an initial power of power, an initial score of 0, and a bag of tokens given as an integer array tokens, where each tokens[i] donates th 阅读全文
posted @ 2020-10-26 04:27 CNoodle 阅读(190) 评论(0) 推荐(0)
摘要:Let's call any (contiguous) subarray B (of A) a mountain if the following properties hold: B.length >= 3 There exists some 0 < i < B.length - 1 such t 阅读全文
posted @ 2020-10-25 11:38 CNoodle 阅读(140) 评论(0) 推荐(0)
摘要:Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i < j < k and ai < ak < aj. Design an algorithm th 阅读全文
posted @ 2020-10-24 07:37 CNoodle 阅读(173) 评论(0) 推荐(0)
摘要:You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep 阅读全文
posted @ 2020-10-21 04:47 CNoodle 阅读(167) 评论(0) 推荐(0)
摘要:You need to construct a binary tree from a string consisting of parenthesis and integers. The whole input represents a binary tree. It contains an int 阅读全文
posted @ 2020-10-21 02:14 CNoodle 阅读(367) 评论(0) 推荐(0)
摘要:Your friend is typing his name into a keyboard. Sometimes, when typing a character c, the key might get long pressed, and the character will be typed 阅读全文
posted @ 2020-10-21 00:30 CNoodle 阅读(169) 评论(0) 推荐(0)
摘要:Given the root of a binary tree, return all duplicate subtrees. For each kind of duplicate subtrees, you only need to return the root node of any one  阅读全文
posted @ 2020-10-19 15:38 CNoodle 阅读(123) 评论(0) 推荐(0)
摘要:You are given a network of n nodes, labeled from 1 to n. You are also given times, a list of travel times as directed edges times[i] = (ui, vi, wi), w 阅读全文
posted @ 2020-10-18 12:52 CNoodle 阅读(246) 评论(0) 推荐(0)
摘要:Given a string s, a k duplicate removal consists of choosing k adjacent and equal letters from s and removing them causing the left and the right side 阅读全文
posted @ 2020-10-18 04:36 CNoodle 阅读(336) 评论(0) 推荐(0)
摘要:Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. We repeatedly make 阅读全文
posted @ 2020-10-18 04:24 CNoodle 阅读(203) 评论(0) 推荐(0)
摘要:Given an array of integers nums and an integer limit, return the size of the longest non-empty subarray such that the absolute difference between any 阅读全文
posted @ 2020-10-16 02:19 CNoodle 阅读(954) 评论(0) 推荐(0)
摘要:Given two strings s and goal, return true if you can swap two letters in s so the result is equal to goal, otherwise, return false. Swapping letters i 阅读全文
posted @ 2020-10-13 01:04 CNoodle 阅读(160) 评论(0) 推荐(0)
摘要:Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree. Exampl 阅读全文
posted @ 2020-10-12 05:10 CNoodle 阅读(255) 评论(0) 推荐(0)
摘要:You are given two strings a and b of the same length. Choose an index and split both strings at the same index, splitting a into two strings: aprefix  阅读全文
posted @ 2020-10-11 15:41 CNoodle 阅读(435) 评论(0) 推荐(0)
摘要:There is an infrastructure of n cities with some number of roads connecting these cities. Each roads[i] = [ai, bi] indicates that there is a bidirecti 阅读全文
posted @ 2020-10-11 13:47 CNoodle 阅读(1501) 评论(0) 推荐(0)
摘要:A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Given the locations and 阅读全文
posted @ 2020-10-07 16:01 CNoodle 阅读(604) 评论(0) 推荐(0)
摘要:Given a string s, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the smallest in lexicogr 阅读全文
posted @ 2020-10-07 07:19 CNoodle 阅读(522) 评论(0) 推荐(0)
摘要:Implement the class UndergroundSystem that supports three methods: 1. checkIn(int id, string stationName, int t) A customer with id card equal to id, 阅读全文
posted @ 2020-10-07 05:22 CNoodle 阅读(522) 评论(0) 推荐(0)
摘要:Given an array of non-negative integers arr, you are initially positioned at start index of the array. When you are at index i, you can jump to i + ar 阅读全文
posted @ 2020-10-07 00:48 CNoodle 阅读(447) 评论(0) 推荐(0)
摘要:Implement a SnapshotArray that supports the following interface: SnapshotArray(int length) initializes an array-like data structure with the given len 阅读全文
posted @ 2020-10-06 13:42 CNoodle 阅读(234) 评论(0) 推荐(0)
摘要:You are given a string s. Reorder the string using the following algorithm: Pick the smallest character from s and append it to the result. Pick the s 阅读全文
posted @ 2020-10-06 10:00 CNoodle 阅读(293) 评论(0) 推荐(0)
摘要:You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smal 阅读全文
posted @ 2020-10-06 01:58 CNoodle 阅读(350) 评论(0) 推荐(0)
摘要:Implement the BSTIterator class that represents an iterator over the in-order traversal of a binary search tree (BST): BSTIterator(TreeNode root) Init 阅读全文
posted @ 2020-10-05 11:39 CNoodle 阅读(900) 评论(0) 推荐(0)
摘要:Given an array intervals where intervals[i] = [li, ri] represent the interval [li, ri), remove all intervals that are covered by another interval in t 阅读全文
posted @ 2020-10-05 04:08 CNoodle 阅读(654) 评论(0) 推荐(0)
摘要:Given an integer array nums, return the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle 阅读全文
posted @ 2020-10-02 02:08 CNoodle 阅读(240) 评论(0) 推荐(0)
摘要:Given m arrays, and each array is sorted in ascending order. Now you can pick up two integers from two different arrays (each array picks one) and cal 阅读全文
posted @ 2020-10-02 01:29 CNoodle 阅读(424) 评论(0) 推荐(0)
摘要:You have a RecentCounter class which counts the number of recent requests within a certain time frame. Implement the RecentCounter class: RecentCounte 阅读全文
posted @ 2020-10-02 00:22 CNoodle 阅读(318) 评论(0) 推荐(0)