摘要: 题目 Reverse bits of a given 32 bits unsigned integer. Example: Input: 43261596 Output: 964176192 Explanation: 43261596 represented in binary as 0000001 阅读全文
posted @ 2018-10-11 10:57 shinjia 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 题目 Given an array, rotate the array to the right by k steps, where k is non negative. Example 1: Input: [1,2,3,4,5,6,7] and k = 3 Output: [5,6,7,1,2,3 阅读全文
posted @ 2018-10-11 10:00 shinjia 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 题目 Given an integer n, return the number of trailing zeroes in n!. Example 1: Input: 3 Output: 0 Explanation: 3! = 6, no trailing zero. Example 2: Inp 阅读全文
posted @ 2018-10-10 08:37 shinjia 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A 1 B 2 C 3 ... Z 26 AA 27 AB 28 ... Example 阅读全文
posted @ 2018-10-10 08:08 shinjia 阅读(89) 评论(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 阅读全文
posted @ 2018-10-09 13:57 shinjia 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题目 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 funct 阅读全文
posted @ 2018-10-09 09:21 shinjia 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a non empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear ru 阅读全文
posted @ 2018-10-08 11:42 shinjia 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For the purpose of this problem 阅读全文
posted @ 2018-10-08 11:02 shinjia 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 题目 Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height balanced binary tree i 阅读全文
posted @ 2018-10-08 10:10 shinjia 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthes 阅读全文
posted @ 2018-10-08 10:07 shinjia 阅读(69) 评论(0) 推荐(0) 编辑