摘要: 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  阅读全文
posted @ 2020-03-29 20:57 米开朗菠萝 阅读(104) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-03-29 20:04 米开朗菠萝 阅读(107) 评论(0) 推荐(0)
摘要: 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] 阅读全文
posted @ 2020-03-29 19:59 米开朗菠萝 阅读(141) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-03-29 17:49 米开朗菠萝 阅读(135) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-03-29 17:20 米开朗菠萝 阅读(179) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-03-29 13:50 米开朗菠萝 阅读(136) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-03-29 11:34 米开朗菠萝 阅读(99) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-03-29 10:09 米开朗菠萝 阅读(130) 评论(0) 推荐(0)