随笔分类 -  LeetCode

LeetCode刷题
摘要:1.题目描述 Write a function to find the longest common prefix string amongst an array of strings. 找到一组字符串的最长前缀。 2.我的分析思路 这一题的第一思路就是,把第一个字符串作为基准,遍历每个子字符串,然 阅读全文
posted @ 2017-02-12 21:06 飞轩 阅读(188) 评论(0) 推荐(0)
摘要:1.题目描述 Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 2.我的分析思路 罗马数字转成阿拉伯数字,这里面需要知道罗马数字的构成 阅读全文
posted @ 2017-02-12 20:58 飞轩 阅读(2596) 评论(0) 推荐(1)
摘要:1.题目描述 Given a string, find the length of the longest substring without repeating characters. Examples: Given =="abcabcbb"==, the answer is =="abc"==, 阅读全文
posted @ 2017-02-12 20:43 飞轩 阅读(210) 评论(0) 推荐(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 阅读全文
posted @ 2017-02-09 09:56 飞轩 阅读(1396) 评论(0) 推荐(0)
摘要:1.题目描述 Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, 1) If you a 阅读全文
posted @ 2017-02-07 21:23 飞轩 阅读(193) 评论(0) 推荐(0)
摘要:1.题目描述 Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = 123, return 321 Note: The input is assumed to be a 32 bit signed inte 阅读全文
posted @ 2017-02-07 09:42 飞轩 阅读(160) 评论(0) 推荐(0)
摘要:1.题目描述 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would 阅读全文
posted @ 2017-02-06 11:42 飞轩 阅读(208) 评论(0) 推荐(0)