上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
摘要: Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is like:3 + ... 阅读全文
posted @ 2015-11-08 08:17 AprilCheny 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 转载自网友zdd的博客『算法-求二进制数中1的个数』问题描述任意给定一个32位无符号整数n,求n的二进制表示中1的个数,比如n = 5(0101)时,返回2,n = 15(1111)时,返回4这也是一道比较经典的题目了,相信不少人面试的时候可能遇到过这道题吧,下面介绍了几种方法来实现这道题,相信很多... 阅读全文
posted @ 2015-11-06 20:23 AprilCheny 阅读(788) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of two.Credits:Special thanks to@jianchao.li.fighterfor adding this problem and creat... 阅读全文
posted @ 2015-11-06 20:18 AprilCheny 阅读(167) 评论(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-11-06 18:56 AprilCheny 阅读(143) 评论(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-11-06 18:15 AprilCheny 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Find the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right corner as shown ... 阅读全文
posted @ 2015-11-06 16:45 AprilCheny 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.According ... 阅读全文
posted @ 2015-11-06 15:31 AprilCheny 阅读(233) 评论(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-11-05 17:29 AprilCheny 阅读(526) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].Note... 阅读全文
posted @ 2015-11-05 10:11 AprilCheny 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Given an array of strings, group anagrams together.For example, given:["eat", "tea", "tan", "ate", "nat", "bat"],Return:[ ["ate", "eat","tea"], ["na... 阅读全文
posted @ 2015-11-04 10:02 AprilCheny 阅读(288) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页