摘要:
Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1num2)return 1; } return 0; }}; 阅读全文
posted @ 2015-02-08 23:33
Vae永Silence
阅读(156)
评论(0)
推荐(0)
摘要:
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional part is repeating,... 阅读全文
posted @ 2015-02-08 23:30
Vae永Silence
阅读(121)
评论(0)
推荐(0)
摘要:
Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文
posted @ 2015-02-08 23:28
Vae永Silence
阅读(122)
评论(0)
推荐(0)
摘要:
Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文
posted @ 2015-02-08 23:26
Vae永Silence
阅读(133)
评论(0)
推荐(0)
摘要:
Related to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A ... 阅读全文
posted @ 2015-02-08 23:24
Vae永Silence
阅读(113)
评论(0)
推荐(0)
摘要:
Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.给定一个整数n,返回n!(n的阶乘)数字中的后缀0的个数。... 阅读全文
posted @ 2015-02-08 23:22
Vae永Silence
阅读(136)
评论(0)
推荐(0)
摘要:
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next... 阅读全文
posted @ 2015-02-08 23:17
Vae永Silence
阅读(108)
评论(0)
推荐(0)
摘要:
The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a... 阅读全文
posted @ 2015-02-08 23:13
Vae永Silence
阅读(170)
评论(0)
推荐(0)
摘要:
Given 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 num... 阅读全文
posted @ 2015-02-08 23:03
Vae永Silence
阅读(137)
评论(0)
推荐(0)
摘要:
找到最多含有两个不同字符的子串的最长长度。例如:eoeabc,最长的是eoe为3,其他都为2.例如:string s="aqaqedadcdccd";使用一个map fmap记录每个字符出现的个数,详解在程序中注释。int lengthOfLongestSubstringTwoDistinct(st... 阅读全文
posted @ 2015-02-08 22:49
Vae永Silence
阅读(127)
评论(0)
推荐(0)