博客专栏  >  编程语言   >  LeetCode

LeetCode

算法学习之地

关注
1 已关注
98篇博文
  • LeetCode 50. Pow(x, n)

    描述 Implement pow(x, n).分析 二分法,xn = xn/2 × xn/2 × xn%2代码class Solution { public: double myPow(d...

    2017-02-07 00:41
    182
  • LeetCode 342. Power of Four

    描述 Given an integer (signed 32 bits), write a function to check whether it is a power of 4.Example:...

    2017-02-07 00:33
    150
  • LeetCode 231. Power of Two

    描述 Given an integer, write a function to determine if it is a power of two.分析 如果是power of two, 则2进...

    2017-02-07 00:17
    76
  • LeetCode 75. Sort Colors

    描述 Given an array with n objects colored red, white or blue, sort them so that objects of the same ...

    2017-02-06 23:52
    159
  • LeetCode 387. 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’...

    2017-02-06 23:24
    134
  • LeetCode 41. First Missing Positive

    描述 Given an unsorted integer array, find the first missing positive integer.For example, Given [1,...

    2017-02-06 23:05
    123
  • LeetCode 18. 4Sum

    描述 Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d =...

    2017-02-06 22:22
    148
  • LeetCode 16. 3Sum Closest

    描述 Given an array S of n integers, find three integers in S such that the sum is closest to a given...

    2017-02-06 21:05
    123
  • LeetCode 344. Reverse String

    描述 Write a function that takes a string as input and returns the string reversed.Example: Given s ...

    2017-02-05 23:04
    146
  • LeetCode 58. Length of Last Word

    描述 Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return t...

    2017-02-05 22:54
    142
  • LeetCode 67. Add Binary

    描述 Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1...

    2017-02-05 22:38
    128
  • LeetCode 12. Integer to Roman

    描述 Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from ...

    2017-02-05 22:20
    132
  • LeetCode 13. Roman to Integer

    描述 Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from ...

    2017-02-05 22:07
    141
  • LeetCode 125. Valid Palindrome

    描述 Given a string, determine if it is a palindrome, considering only alphanumeric characters and ig...

    2017-02-05 19:28
    117
  • LeetCode 48. Rotate Image

    描述 You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise...

    2017-02-05 18:24
    137
  • LeetCode 60. Permutation Sequence

    描述 The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of th...

    2017-02-05 17:55
    145
  • LeetCode 46. Permutations

    描述 Given a collection of distinct numbers, return all possible permutations.For example, [1,2,3] h...

    2017-02-05 17:29
    158
  • LeetCode 31. Next Permutation

    描述 Implement next permutation, which rearranges numbers into the lexicographically next greater per...

    2017-02-05 16:42
    370
  • LeetCode 70. Climbing Stairs

    描述You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb...

    2017-02-05 12:14
    136
  • LeetCode 33. Search in Rotated Sorted Array

    描述 Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i...

    2017-02-03 23:48
    115

img博客搬家
img撰写博客
img专家申请
img意见反馈
img返回顶部