摘要: leetcode - ZigZag ConversionThe string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display t... 阅读全文
posted @ 2015-06-12 16:39 cnblogshnj 阅读(118) 评论(0) 推荐(0) 编辑
摘要: leetcode - Intersection of Two Linked ListsWrite a program to find the node at which the intersection of two singly linked lists begins.For example, t... 阅读全文
posted @ 2015-06-09 14:18 cnblogshnj 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 查看python版本:python –version低于 2.6 的,需要升级一下。然后安装 PIP 环境:apt-get install python-gevent python-pip安装shadowsocks:pip install shadowsocks新建配置文件:{"server":"i... 阅读全文
posted @ 2015-05-31 15:40 cnblogshnj 阅读(118) 评论(0) 推荐(0) 编辑
摘要: leetcode - Compare Version NumbersCompare two version numbers version1 and version2.If version1 > version2 return 1, if version1 ver2[k]) return 1;28 ... 阅读全文
posted @ 2015-05-18 12:43 cnblogshnj 阅读(132) 评论(0) 推荐(0) 编辑
摘要: leetcode - Excel Sheet Column NumberRelated to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its correspon... 阅读全文
posted @ 2015-05-13 17:27 cnblogshnj 阅读(128) 评论(0) 推荐(0) 编辑
摘要: leetcode - Rotate ArrayRotate 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 t... 阅读全文
posted @ 2015-05-13 17:08 cnblogshnj 阅读(120) 评论(0) 推荐(0) 编辑
摘要: leetcode - Factorial Trailing ZeroesGiven an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time c... 阅读全文
posted @ 2015-05-13 13:20 cnblogshnj 阅读(93) 评论(0) 推荐(0) 编辑
摘要: leetcode - Reverse BitsReverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 000000101001010000... 阅读全文
posted @ 2015-05-12 17:43 cnblogshnj 阅读(152) 评论(0) 推荐(0) 编辑
摘要: leetcode - Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight... 阅读全文
posted @ 2015-05-12 17:01 cnblogshnj 阅读(125) 评论(0) 推荐(0) 编辑
摘要: leetcode - happy numberWrite an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting wi... 阅读全文
posted @ 2015-05-12 16:46 cnblogshnj 阅读(161) 评论(0) 推荐(0) 编辑