- 博客(15)
- 收藏
- 关注
原创 347. Top K Frequent Elements [medium] (Python)
题目链接https://leetcode.com/problems/top-k-frequent-elements/题目原文 Given a non-empty array of integers, return the k most frequent elements. For example, Given [1,1,1,2,2,3] and k = 2, return [1,
2016-07-30 21:04:11 5858 1
原创 122. Best Time to Buy and Sell Stock II [medium] (Python)
题目链接https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/题目原文 Say you have an array for which the ithi^{th} element is the price of a given stock on day ii. Design an algorithm to fi
2016-07-30 12:31:23 2277
原创 238. Product of Array Except Self [medium] (Python)
题目链接https://leetcode.com/problems/product-of-array-except-self/题目原文 Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the eleme
2016-07-30 11:46:33 2587
原创 260. Single Number III [medium] (Python)
题目链接https://leetcode.com/problems/single-number-iii/题目原文 Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two e
2016-07-30 10:58:25 1742
原创 136. Single Number [medium] (Python)
题目链接https://leetcode.com/problems/single-number/题目原文 Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear ru
2016-07-29 14:30:31 4009
原创 338. Counting Bits [medium] (Python)
题目链接https://leetcode.com/problems/counting-bits/题目原文 Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation a
2016-07-29 13:27:16 2767
原创 8. String to Integer (atoi) [easy] (Python)
题目链接https://leetcode.com/problems/string-to-integer-atoi/题目原文 Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please
2016-07-28 11:47:13 6751
原创 189. Rotate Array [easy] (Python)
题目链接https://leetcode.com/problems/rotate-array/题目原文 Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4
2016-07-28 10:32:27 5623
原创 278. First Bad Version [easy] (Python)
题目链接https://leetcode.com/problems/first-bad-version/题目原文 You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the q
2016-07-27 18:19:57 3620
原创 155. Min Stack [easy] (Python)
题目链接https://leetcode.com/problems/min-stack/题目原文 Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) – Push element x onto stack. pop()
2016-07-27 17:13:13 3764
原创 7. Reverse Integer [easy] (Python)
题目链接https://leetcode.com/problems/reverse-integer/题目原文 Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321题目翻译反转整数中的数字。 例子1:给定x=123,返回321;例子2:给定x=-123,
2016-07-26 21:50:37 10494 2
原创 6. ZigZag Conversion [easy] (Python)
题目链接https://leetcode.com/problems/zigzag-conversion/题目原文 The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fix
2016-07-26 21:13:40 3687
原创 1. Two Sum [easy] (Python)
题目链接https://leetcode.com/problems/two-sum/题目原文 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have e
2016-07-26 20:19:37 14030 1
原创 374. Guess Number Higher or Lower [easy] (Python)
题目链接https://leetcode.com/problems/guess-number-higher-or-lower/题目原文 We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked.
2016-07-26 19:49:27 3084
原创 371. Sum of Two Integers [easy] (Python)
题目链接https://leetcode.com/problems/sum-of-two-integers/题目原文 Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example: Given a = 1 and b = 2, retu
2016-07-26 12:08:46 6900 2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人