博客园  :: 首页  :: 新随笔  :: 订阅 订阅  :: 管理

2015年4月22日

摘要: Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer... 阅读全文

posted @ 2015-04-22 19:08 NUST小文 阅读(140) 评论(0) 推荐(0) 编辑

摘要: Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at... 阅读全文

posted @ 2015-04-22 19:06 NUST小文 阅读(109) 评论(0) 推荐(0) 编辑

2015年4月21日

摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.AC代码如下:Li... 阅读全文

posted @ 2015-04-21 22:44 NUST小文 阅读(110) 评论(0) 推荐(0) 编辑

摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文

posted @ 2015-04-21 21:52 NUST小文 阅读(126) 评论(0) 推荐(0) 编辑

2015年4月15日

摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文

posted @ 2015-04-15 21:40 NUST小文 阅读(109) 评论(0) 推荐(0) 编辑

摘要: Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i... 阅读全文

posted @ 2015-04-15 20:23 NUST小文 阅读(118) 评论(0) 推荐(0) 编辑

2015年4月8日

摘要: Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ... 阅读全文

posted @ 2015-04-08 21:52 NUST小文 阅读(99) 评论(0) 推荐(0) 编辑

2015年4月7日

摘要: Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文

posted @ 2015-04-07 22:41 NUST小文 阅读(105) 评论(0) 推荐(0) 编辑

摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文

posted @ 2015-04-07 20:53 NUST小文 阅读(160) 评论(0) 推荐(0) 编辑

2015年4月6日

摘要: 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-04-06 21:54 NUST小文 阅读(118) 评论(0) 推荐(0) 编辑