10 2020 档案
摘要:思路:用map.put(cur_sum, i); 动不动就break 一开始设置end = -1是因为没找到 https://www.geeksforgeeks.org/find-subarray-with-given-sum-in-array-of-integers/ // Java progra
阅读全文
摘要:Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that
阅读全文
摘要:Given an array of integers nums and an integer k, return the total number of continuous subarrays whose sum equals to k. Example 1: Input: nums = [1,1
阅读全文
摘要:整理公司列表-弄清楚,因为这是基础,以后也可以用地里有面经的公司(不多)先投(low key用领英)- 这个也尽量做列表中的其他公司,感兴趣的,看看是什么情况?- 这个随意
阅读全文
摘要:小部件制造商面临对其新产品的意外高需求。他们想满足尽可能多的客户。给定可用的小部件数量和客户订单列表,制造商最多可以完全满足的订单数量是多少? 功能说明 在下面的编辑器中完成功能fillOrders。该函数必须返回一个整数,该整数表示已完成订单的最大数量。 fillOrders具有以下参数: ord
阅读全文
摘要:Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one duplicate number in n
阅读全文
摘要:Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes
阅读全文
摘要: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
阅读全文
摘要:思路:就是把gcd拆一下,因为如果GCD可以,这些数就也可以3,6 gcd = n = 3 1/3 没了,0 += 2 GCD辗转相除法:b一开始是除数,后来是余数。余数为0就行了 16 4 4,4 4,0 所以返回a = 4 https://www.geeksforgeeks.org/common
阅读全文
摘要:Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -- whose elements may also be integ
阅读全文
摘要:Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in
阅读全文
摘要:Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if:
阅读全文
摘要:Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,
阅读全文
摘要:Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. Example:Assume that words = ["p
阅读全文
摘要:Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB ->
阅读全文
摘要:Given a list of non-negative integers nums, arrange them such that they form the largest number. Note: The result may be very large, so you need to re
阅读全文
摘要:Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearrang
阅读全文
摘要:Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Input: s = "anagram", t = "nagaram" Output: true Example
阅读全文
摘要:Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Input: "aba" Output: True Exa
阅读全文
摘要:Given an input string s, reverse the order of the words. A word is defined as a sequence of non-space characters. The words in s will be separated by
阅读全文