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 阅读全文
posted @ 2020-10-31 05:28 苗妙苗 阅读(94) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-31 05:19 苗妙苗 阅读(81) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-31 05:05 苗妙苗 阅读(92) 评论(0) 推荐(0)
摘要:整理公司列表-弄清楚,因为这是基础,以后也可以用地里有面经的公司(不多)先投(low key用领英)- 这个也尽量做列表中的其他公司,感兴趣的,看看是什么情况?- 这个随意 阅读全文
posted @ 2020-10-30 09:38 苗妙苗 阅读(49) 评论(0) 推荐(0)
摘要:小部件制造商面临对其新产品的意外高需求。他们想满足尽可能多的客户。给定可用的小部件数量和客户订单列表,制造商最多可以完全满足的订单数量是多少? 功能说明 在下面的编辑器中完成功能fillOrders。该函数必须返回一个整数,该整数表示已完成订单的最大数量。 fillOrders具有以下参数: ord 阅读全文
posted @ 2020-10-29 10:30 苗妙苗 阅读(146) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-27 22:36 苗妙苗 阅读(88) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-27 07:18 苗妙苗 阅读(57) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-26 23:34 苗妙苗 阅读(89) 评论(0) 推荐(0)
摘要:思路:就是把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 阅读全文
posted @ 2020-10-26 10:19 苗妙苗 阅读(91) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-25 23:05 苗妙苗 阅读(76) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-25 09:57 苗妙苗 阅读(251) 评论(0) 推荐(0)
摘要:Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: 阅读全文
posted @ 2020-10-25 00:39 苗妙苗 阅读(89) 评论(0) 推荐(0)
摘要: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, 阅读全文
posted @ 2020-10-24 11:20 苗妙苗 阅读(114) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-21 22:45 苗妙苗 阅读(146) 评论(0) 推荐(0)
摘要: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 -> 阅读全文
posted @ 2020-10-21 10:18 苗妙苗 阅读(146) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-20 10:46 苗妙苗 阅读(129) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-19 22:27 苗妙苗 阅读(116) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-19 11:15 苗妙苗 阅读(94) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-18 09:09 苗妙苗 阅读(108) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-18 00:08 苗妙苗 阅读(106) 评论(0) 推荐(0)