随笔分类 - leetcode
摘要:https://leetcode-cn.com/problems/fu-za-lian-biao-de-fu-zhi-lcof/ /* struct RandomListNode { int label; struct RandomListNode *next, *random; RandomLis
        阅读全文
            
摘要:解题思路: 代码: class Solution: def myPow(self, x: float, n: int) -> float: if x == 0: return 0 res = 1 if n < 0: x, n = 1 / x, -n while n: if n & 1: res *=
        阅读全文
            
摘要:Given a list of daily temperatures T, return a list such that, for each day in the input, tells you how many days you would have to wait until a warme
        阅读全文
            
摘要:Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n
        阅读全文
            
摘要:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Remov
        阅读全文
            
摘要:Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 
        阅读全文
            
摘要:Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two di
        阅读全文
            
摘要:Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] 
        阅读全文
            
摘要:Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexi
        阅读全文
            
摘要:Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: Input: [3,0,1] Output
        阅读全文
            
摘要:Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the 
        阅读全文
            
摘要:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr
        阅读全文
            
摘要:Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: [1,2,3,4,5,6,7] and k = 3 Output: [5,6,7,1,2,3,4]
        阅读全文
            
摘要:At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bil
        阅读全文
            
摘要:A string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one p
        阅读全文
            
摘要:Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a g
        阅读全文
            
摘要:There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the hor
        阅读全文
            
摘要:Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. Note: The l
        阅读全文
            
摘要:Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple
        阅读全文
            
摘要:Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim
        阅读全文
            

 
 浙公网安备 33010602011771号
浙公网安备 33010602011771号