LeetCode Divide Two Integers DescriptionDivide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. The original problem is here.The original code is here. 4月 3 2015 #leetcode
LeetCode Balanced Binary Tree DescriptionGiven a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node nev 4月 1 2015 #leetcode
Linux系统环境下使用iconv实现文件编码格式的转换 简介Linux系统环境下,有很多处理文件编码格式的方法,比如vim中,使用“set fileencoding=utf-8”可以实现编码格式到UTF8格式的转换。但是个人觉得iconv更加好用些,下面就介绍下如何使用。 iconv使用方法下面是iconv的使用方法,比较重要的参数就是 “-f”:给出输入文件的编码格式,比如GBK; “-t”:指定输出文件的编码格式; “-o”:指定输出文件的文件名。 3月 31 2015 #Linux
LeetCode Find Peak Element DescriptionA peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its index. The array may contain multiple peaks 3月 30 2015 #leetcode
LeetCode Compare Version Numbers DescriptionCompare two version numbers version1 and version2.If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assume that the version strings are no 3月 30 2015 #leetcode
LeetCode Factorial Trailing Zeroes DescriptionGiven an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. The original problem is here. The original code is here. 3月 30 2015 #leetcode
LeetCode Largest Number DescriptionGiven a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330. Note: The result may 3月 29 2015 #leetcode
LeetCode Reverse Bits DescriptionReverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 0 3月 22 2015 #leetcode
LeetCode Rotate Array DescriptionRotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. Note:Try to come up as many solutions as y 3月 20 2015 #leetcode
LeetCode Reverse Integer DescriptionReverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 The original problem is here: 3月 15 2015 #leetcode