摘要: Excel Sheet Column Title Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A 2 -> B 3 -> 阅读全文
posted @ 2016-05-10 20:26 Juntaran 阅读(242) 评论(0) 推荐(0) 编辑
摘要: Reverse String Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 阅读全文
posted @ 2016-05-10 19:17 Juntaran 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Power of Four Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example: Given num = 16, return true. Given num 阅读全文
posted @ 2016-05-10 19:16 Juntaran 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Integer Break Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return t 阅读全文
posted @ 2016-05-10 19:16 Juntaran 阅读(210) 评论(0) 推荐(0) 编辑
摘要: Power of Three Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using any loop / recursio 阅读全文
posted @ 2016-05-10 19:15 Juntaran 阅读(139) 评论(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-10 19:15 Juntaran 阅读(218) 评论(0) 推荐(0) 编辑
摘要: Bulb Switcher There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you 阅读全文
posted @ 2016-05-10 19:14 Juntaran 阅读(299) 评论(0) 推荐(0) 编辑
摘要: Missing Number Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example, Give 阅读全文
posted @ 2016-05-10 19:12 Juntaran 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Valid Anagram Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = "anagram", t = "nagaram", return true 阅读全文
posted @ 2016-05-10 19:11 Juntaran 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Power of Two Given an integer, write a function to determine if it is a power of two. 阅读全文
posted @ 2016-05-10 19:10 Juntaran 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Excel Sheet Column Number Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding colu 阅读全文
posted @ 2016-05-10 19:09 Juntaran 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Contains Duplicate Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at lea 阅读全文
posted @ 2016-05-10 19:09 Juntaran 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Majority Element Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You ma 阅读全文
posted @ 2016-05-10 19:08 Juntaran 阅读(192) 评论(0) 推荐(0) 编辑