摘要: 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 阅读(134) 评论(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 阅读(187) 评论(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 阅读(148) 评论(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 阅读(155) 评论(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 阅读(145) 评论(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 阅读(111) 评论(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 阅读(170) 评论(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 阅读(140) 评论(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 阅读(176) 评论(0) 推荐(0)
摘要: leetcode - Remove Linked List Elements 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next;... 阅读全文
posted @ 2015-05-12 12:35 cnblogshnj 阅读(139) 评论(0) 推荐(0)