496. Next Greater Element I(C++)

题目 You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for ...

2017-02-28 12:12:57

阅读数 319

评论数 0

167. Two Sum II - Input array is sorted (C++)

题目 Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The...

2017-02-28 00:19:42

阅读数 248

评论数 0

LeetCode:338. Counting Bits(C++)

题目 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...

2017-02-27 20:55:57

阅读数 222

评论数 0

412. Fizz Buzz(C++)

LeetCode:412. Fizz Buzz(C++)

2017-02-26 14:23:20

阅读数 297

评论数 0

500. Keyboard Row

题目 Given a List of words, return the words that can be typed using letters of alphabet on only one row’s of American keyboard like the image below....

2017-02-25 19:34:01

阅读数 206

评论数 0


目前有三种常用的求两个数的最大公约数的方法: 1. 欧几里得算法 2. 连续整数检测算法 3. 分解质因数算法1.1 更相减损法 可半者半之,不可半者,副置分母、子之数,以少减多,更相减损,求其等也。以等数约之 判断是否存在偶数,如果有,则先除以二,然后大数减小数,差和小的那个数比...

2017-02-24 21:34:13

阅读数 401

评论数 0

419. Battleships in a Board

题目 Given an 2D board, count how many battleships are in it. The battleships are represented with ‘X’s, empty slots are represented with ‘.’s. You m...

2017-02-23 23:43:21

阅读数 244

评论数 0

476. Number Complement (C++)

题目 Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: Th...

2017-02-23 00:46:56

阅读数 278

评论数 0

取消 删除