摘要: Write a function to find the longest common prefix string amongst an array of strings. 题意:编写一个函数来查找字符串数组中最长的公共前缀字符串。 例如:['abc','ab','a'],输出a 思路:从任意一个字 阅读全文
posted @ 2017-12-28 10:28 十二Zh 阅读(97) 评论(0) 推荐(0)
摘要: 题意:输入一个罗马数字,把它转化成对应整数 阅读全文
posted @ 2017-12-28 08:53 十二Zh 阅读(106) 评论(0) 推荐(0)
摘要: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 题意:将一个整数转化成罗马数字。输入的数字在1-3999的范围 思路:罗马数字共有七 阅读全文
posted @ 2017-12-27 17:02 十二Zh 阅读(154) 评论(0) 推荐(0)
摘要: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文
posted @ 2017-12-27 11:50 十二Zh 阅读(94) 评论(0) 推荐(0)
摘要: Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are thi 阅读全文
posted @ 2017-12-27 11:08 十二Zh 阅读(130) 评论(0) 推荐(0)
摘要: Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below 阅读全文
posted @ 2017-12-26 11:06 十二Zh 阅读(140) 评论(0) 推荐(0)
摘要: Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Note:Assume we are dealing with an environment which cou 阅读全文
posted @ 2017-12-26 09:06 十二Zh 阅读(112) 评论(0) 推荐(0)
摘要: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: 题意:找到一个字符串的最长回文子 阅读全文
posted @ 2017-12-18 14:58 十二Zh 阅读(121) 评论(0) 推荐(0)
摘要: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng 阅读全文
posted @ 2017-12-14 11:03 十二Zh 阅读(154) 评论(0) 推荐(1)
摘要: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai 阅读全文
posted @ 2017-12-13 18:45 十二Zh 阅读(219) 评论(0) 推荐(0)