上一页 1 ··· 9 10 11 12 13 14 下一页
摘要: 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 elements 阅读全文
posted @ 2016-05-15 20:28 米开朗菠萝 阅读(228) 评论(0) 推荐(0)
摘要: Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime complex 阅读全文
posted @ 2016-05-15 19:58 米开朗菠萝 阅读(146) 评论(0) 推荐(0)
摘要: 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 and r 阅读全文
posted @ 2016-05-15 19:47 米开朗菠萝 阅读(209) 评论(0) 推荐(0)
摘要: Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For exa 阅读全文
posted @ 2016-05-15 16:20 米开朗菠萝 阅读(189) 评论(0) 推荐(0)
摘要: Given an integer, write a function to determine if it is a power of two. 2的幂数二进制只有一个1 阅读全文
posted @ 2016-05-11 22:16 米开朗菠萝 阅读(107) 评论(0) 推荐(0)
摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2016-05-11 22:10 米开朗菠萝 阅读(169) 评论(0) 推荐(0)
摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
posted @ 2016-05-11 21:40 米开朗菠萝 阅读(130) 评论(0) 推荐(0)
摘要: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, giv 阅读全文
posted @ 2016-05-11 21:17 米开朗菠萝 阅读(134) 评论(0) 推荐(0)
摘要: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 阅读全文
posted @ 2016-05-11 20:49 米开朗菠萝 阅读(127) 评论(0) 推荐(0)
摘要: You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 ston 阅读全文
posted @ 2016-05-11 20:15 米开朗菠萝 阅读(166) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 下一页