随笔分类 - LeetCode
LeetCode刷题
摘要:1.题目描述 Write a function to find the longest common prefix string amongst an array of strings. 找到一组字符串的最长前缀。 2.我的分析思路 这一题的第一思路就是,把第一个字符串作为基准,遍历每个子字符串,然
阅读全文
摘要:1.题目描述 Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 2.我的分析思路 罗马数字转成阿拉伯数字,这里面需要知道罗马数字的构成
阅读全文
摘要:1.题目描述 Given a string, find the length of the longest substring without repeating characters. Examples: Given =="abcabcbb"==, the answer is =="abc"==,
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号