随笔分类 - LeetCode
摘要:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or
        阅读全文
            
摘要:Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime com
        阅读全文
            
摘要:Given a sorted (in ascending order) integer array nums of n elements and a targetvalue, write a function to search target in nums. If target exists, t
        阅读全文
            
摘要:Given an array of integers nums, sort the array in ascending order. Example 1: Example 2: Note: 排序 参考https://www.cnblogs.com/zhacai/p/11011961.html
        阅读全文
            
摘要:Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn't 
        阅读全文
            
摘要:A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p
        阅读全文
            
摘要:A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p
        阅读全文
            
摘要:Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer 
        阅读全文
            
摘要:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet
        阅读全文
            
摘要:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the
        阅读全文
            
摘要:There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct
        阅读全文
            
摘要:Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen
        阅读全文
            
摘要:Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 operations permitt
        阅读全文
            
摘要:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee
        阅读全文
            
摘要:Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Note: There may be more than one LIS combination, it 
        阅读全文
            
摘要:Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer feerepresent
        阅读全文
            
摘要: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
        阅读全文
            
摘要: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
        阅读全文
            
摘要: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 integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: E
        阅读全文
            
                    
                
浙公网安备 33010602011771号