上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 80 下一页
摘要: Given a range [m, n] where 0 = 0 && ((m & (1 << t)) == (n & (1 << t)))) { ans |= m & (1 << t); t--; } retur... 阅读全文
posted @ 2015-04-16 22:34 匡子语 阅读(178) 评论(0) 推荐(0)
摘要: Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom.For exampl... 阅读全文
posted @ 2015-04-16 22:30 匡子语 阅读(165) 评论(0) 推荐(0)
摘要: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo... 阅读全文
posted @ 2015-04-16 22:29 匡子语 阅读(232) 评论(0) 推荐(0)
摘要: Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321总结:处理整数溢出的方法①用数据类型转换long 或 long long②在每次循环时先保存下数字变化之前的值,处理后单步恢复... 阅读全文
posted @ 2015-04-15 21:37 匡子语 阅读(227) 评论(0) 推荐(0)
摘要: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe... 阅读全文
posted @ 2015-04-15 16:25 匡子语 阅读(208) 评论(0) 推荐(0)
摘要: Given an array of words and a lengthL, format the text such that each line has exactlyLcharacters and is fully (left and right) justified.You should p... 阅读全文
posted @ 2015-04-14 18:54 匡子语 阅读(240) 评论(0) 推荐(0)
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo... 阅读全文
posted @ 2015-04-14 09:58 匡子语 阅读(243) 评论(0) 推荐(0)
摘要: Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ... 阅读全文
posted @ 2015-04-10 17:17 匡子语 阅读(228) 评论(0) 推荐(0)
摘要: GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]... 阅读全文
posted @ 2015-04-10 17:01 匡子语 阅读(200) 评论(0) 推荐(0)
摘要: Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a... 阅读全文
posted @ 2015-04-09 10:30 匡子语 阅读(170) 评论(0) 推荐(0)
上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 80 下一页