12 2020 档案

摘要:We have an array of integers, and an array of queries. For the th query , we add val to . Then, the answer to the th query is the sum of the even valu 阅读全文
posted @ 2020-12-31 14:23 Grandyang 阅读(528) 评论(0) 推荐(0) 编辑
摘要:Given two integers and , return any string such that: has length and contains exactly `'a' b` letters, The substring does not occur in , and The subst 阅读全文
posted @ 2020-12-30 13:15 Grandyang 阅读(725) 评论(0) 推荐(0) 编辑
摘要:In a country popular for train travel, you have planned some train travelling one year in advance. The days of the year that you will travel is given 阅读全文
posted @ 2020-12-29 12:21 Grandyang 阅读(1893) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers , find the number of triples of indices (i, j, k) such that: `0 这道题给了一个数组,定义了一种三元组,使得这三个数字相‘与’得到为0,问有多少种不同的组合。根据题目中的例子可以发现, 阅读全文
posted @ 2020-12-28 11:07 Grandyang 阅读(498) 评论(0) 推荐(0) 编辑
摘要:Create a timebased key value store class , that supports two operations. 1\. Stores the and , along with the given . 2\. Returns a value such that was 阅读全文
posted @ 2020-12-27 04:01 Grandyang 阅读(2257) 评论(0) 推荐(0) 编辑
摘要:On a 2 dimensional , there are 4 types of squares: represents the starting square. There is exactly one starting square. represents the ending square. 阅读全文
posted @ 2020-12-26 09:42 Grandyang 阅读(1729) 评论(2) 推荐(0) 编辑
摘要:You are given the root of a binary tree with n nodes where each node in the tree has node.val coins and there are n coins total. In one move, we may c 阅读全文
posted @ 2020-12-25 13:09 Grandyang 阅读(1832) 评论(3) 推荐(0) 编辑
摘要:Given an integer array , return the length of a maximum size turbulent subarray of . A subarray is turbulent if the comparison sign flips between each 阅读全文
posted @ 2020-12-24 14:07 Grandyang 阅读(957) 评论(0) 推荐(2) 编辑
摘要:Given an array of positive lengths, return the largest perimeter of a triangle with non zero area, formed from 3 of these lengths. If it is impossible 阅读全文
posted @ 2020-12-22 13:32 Grandyang 阅读(987) 评论(0) 推荐(0) 编辑
摘要:Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: I 阅读全文
posted @ 2020-12-22 13:30 Grandyang 阅读(2322) 评论(0) 推荐(1) 编辑
摘要:You are given an integer array . From some starting index, you can make a series of jumps. The (1st, 3rd, 5th, ...) jumps in the series are called odd 阅读全文
posted @ 2020-12-21 14:32 Grandyang 阅读(1327) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers, return the number of (contiguous, non empty) subarrays that have a sum divisible by . Example 1: Note: 1. `1 这道题给了一个数组,让返回 阅读全文
posted @ 2020-12-20 12:43 Grandyang 阅读(1996) 评论(0) 推荐(0) 编辑
摘要:We have a list of on the plane. Find the closest points to the origin . (Here, the distance between two points on a plane is the Euclidean distance.) 阅读全文
posted @ 2020-12-19 16:00 Grandyang 阅读(3040) 评论(0) 推荐(0) 编辑
摘要:Given two strings and , each of which represents a non negative rational number, return True if and only if they represent the same number. The string 阅读全文
posted @ 2020-12-18 15:15 Grandyang 阅读(391) 评论(0) 推荐(0) 编辑
摘要:You are given the root of a binary tree with n nodes, where each node is uniquely assigned a value from 1 to n. You are also given a sequence of n val 阅读全文
posted @ 2020-12-17 15:57 Grandyang 阅读(675) 评论(0) 推荐(0) 编辑
摘要:Given two positive integers and , an integer is powerful if it is equal to for some integers and . Return a list of all powerful integers that have va 阅读全文
posted @ 2020-12-16 12:39 Grandyang 阅读(603) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers , sort the array by performing a series of pancake flips. In one pancake flip we do the following steps: Choose an integer 阅读全文
posted @ 2020-12-15 14:50 Grandyang 阅读(1104) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, we install cameras on the nodes of the tree. Each camera at a node can monitor its parent, itself, and its immediate children. Ca 阅读全文
posted @ 2020-12-14 08:54 Grandyang 阅读(1917) 评论(0) 推荐(1) 编辑
摘要:Return all non negative integers of length such that the absolute difference between every two consecutive digits is . Note that every number in the a 阅读全文
posted @ 2020-12-13 07:17 Grandyang 阅读(660) 评论(0) 推荐(0) 编辑
摘要:Given a wordlist, we want to implement a spellchecker that converts a query word into a correct word. For a given query word, the spell checker handle 阅读全文
posted @ 2020-12-12 15:32 Grandyang 阅读(626) 评论(0) 推荐(0) 编辑
摘要:Given the root of a binary tree, calculate the vertical order traversal of the binary tree. For each node at position (row, col), its left and right c 阅读全文
posted @ 2020-12-11 15:38 Grandyang 阅读(1851) 评论(3) 推荐(0) 编辑
摘要:A binary tree is univalued if every node in the tree has the same value. Return if and only if the given tree is univalued. Example 1: Example 2: Note 阅读全文
posted @ 2020-12-10 13:51 Grandyang 阅读(554) 评论(0) 推荐(0) 编辑
摘要:Given a single positive integer , we will write an expression of the form where each operator , , etc. is either addition, subtraction, multiplication 阅读全文
posted @ 2020-12-09 15:56 Grandyang 阅读(660) 评论(2) 推荐(0) 编辑
摘要:Given a set of points in the xy plane, determine the minimum area of any rectangle formed from these points, with sides not necessarily parallel to th 阅读全文
posted @ 2020-12-08 15:56 Grandyang 阅读(1064) 评论(0) 推荐(0) 编辑

Fork me on GitHub