自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Coder_Orz的博客

请赐我成为大神的力量吧...Orz...

  • 博客(90)
  • 收藏
  • 关注

原创 382. Linked List Random Node [medium] (Python)

题目链接https://leetcode.com/problems/linked-list-random-node/题目原文 Given a singly linked list, return a random node’s value from the linked list. Each node must have the same probability of being chosen.

2016-09-01 12:20:33 2040 1

原创 167. Two Sum II - Input array is sorted [medium] (Python)

题目链接https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/题目原文 Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific targ

2016-08-31 19:33:40 5404

原创 387. First Unique Character in a String [easy] (Python)

题目链接https://leetcode.com/problems/first-unique-character-in-a-string/题目原文 Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1. Exam

2016-08-31 19:15:49 4079

原创 383. Ransom Note [easy] (Python)

题目链接https://leetcode.com/problems/ransom-note/题目原文> Given
 an 
arbitrary
 ransom
 note
 string 
and 
another 
string 
containing 
letters from
 all 
the 
magazines,
 write 
a 
function 
that 
will 
ret

2016-08-31 19:09:41 3266

原创 389. Find the Difference [easy] (Python)

题目链接https://leetcode.com/problems/find-the-difference/题目原文 Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one mo

2016-08-31 18:35:58 3775

原创 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 5831 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 2239

原创 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 2548

原创 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 1702

原创 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 3967

原创 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 2715

原创 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 6713

原创 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 5595

原创 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 3564

原创 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 3733

原创 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 10409 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 3623

原创 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 13977 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 3036

原创 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 6850 2

原创 303. Range Sum Query - Immutable [easy] (Python)

题目链接https://leetcode.com/problems/range-sum-query-immutable/题目原文 Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Given nums = [-

2016-06-20 15:20:23 3050

原创 28. Implement strStr() [easy] (Python)

题目链接https://leetcode.com/problems/implement-strstr/题目原文 Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.题目翻译实现 strSt

2016-06-19 01:25:02 7693 5

原创 67. Add Binary [easy] (Python)

题目链接https://leetcode.com/problems/add-binary/题目原文 题目翻译思路方法思路一代码说明思路二代码说明思路三代码说明PS: 新手刷LeetCode,新手写博客,写错了或者写的不清楚还请帮忙指出,谢谢! 转载请注明:

2016-06-18 17:29:55 7467 2

原创 14. Longest Common Prefix [easy] (Python)

题目链接https://leetcode.com/problems/longest-common-prefix/题目原文 Write a function to find the longest common prefix string amongst an array of strings.题目翻译写个函数,找出一个字符串数组中所有字符串的最长公共前缀。 题目描述不清晰。。。补充几个例子,

2016-06-18 17:06:51 10306 2

原创 203. Remove Linked List Elements [easy] (Python)

题目链接https://leetcode.com/problems/remove-linked-list-elements/题目原文 Remove all elements from a linked list of integers that have value val. Example Given: 1 –> 2 –> 6 –> 3 –> 4 –> 5 –> 6, val

2016-06-18 16:30:01 6931 1

原创 257. Binary Tree Paths [easy] (Python)

题目链接https://leetcode.com/problems/binary-tree-paths/题目原文 Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \2 3 \ 5 All root-t

2016-06-18 15:55:42 6548

原创 190. Reverse Bits [easy] (Python)

题目链接https://leetcode.com/problems/reverse-bits/题目原文 Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100

2016-06-18 11:04:11 5959

原创 38. Count and Say [easy] (Python)

题目链接https://leetcode.com/problems/count-and-say/题目原文 The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1"

2016-06-17 19:55:49 7203 1

原创 58. Length of Last Word [easy] (Python)

题目链接https://leetcode.com/problems/length-of-last-word/题目原文 Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string. I

2016-06-17 19:41:16 5167

原创 20. Valid Parentheses [easy] (Python)

题目链接https://leetcode.com/problems/valid-parentheses/题目原文 Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. The brackets must

2016-06-17 10:18:55 8166 1

原创 290. Word Pattern [easy] (Python)

题目链接https://leetcode.com/problems/word-pattern/题目原文 Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between

2016-06-16 17:48:27 5140 2

原创 19. Remove Nth Node From End of List [easy] (Python)

题目链接https://leetcode.com/problems/remove-nth-node-from-end-of-list/题目原文 Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1

2016-06-16 13:36:34 2853

原创 205. Isomorphic Strings [easy] (Python)

题目链接https://leetcode.com/problems/isomorphic-strings/题目原文 Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t.

2016-06-15 14:02:47 5653

原创 88. Merge Sorted Array [easy] (Python)

题目链接https://leetcode.com/problems/merge-sorted-array/题目原文 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume that nums1 has enou

2016-06-15 13:54:39 7595 1

原创 223. Rectangle Area [easy] (Python)

题目链接https://leetcode.com/problems/rectangle-area/题目原文 Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bottom left corner and top right c

2016-06-15 11:24:21 2624

原创 219. Contains Duplicate II [easy] (Python)

题目链接https://leetcode.com/problems/contains-duplicate-ii/题目原文 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

2016-06-14 19:59:14 3991

原创 160. Intersection of Two Linked Lists [easy] (Python)

题目链接https://leetcode.com/problems/intersection-of-two-linked-lists/题目原文 Write a program to find the node at which the intersection of two singly linked lists begins. For example, the foll

2016-06-08 21:23:41 4170

原创 225. Implement Stack using Queues [easy] (Python)

题目链接https://leetcode.com/problems/implement-stack-using-queues/题目原文 Implement the following operations of a stack using queues. 1. push(x) – Push element x onto stack. 2. pop() – Removes

2016-06-07 16:57:33 3488

原创 36. Valid Sudoku [easy] (Python)

题目链接https://leetcode.com/problems/valid-sudoku/题目原文 Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are fi

2016-06-06 16:35:20 4775 3

原创 112. Path Sum [easy] (Python)

题目链接https://leetcode.com/problems/path-sum/题目原文 Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.

2016-06-06 15:28:13 3814

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除