LeetCode
qiulinsama
一只菜鸡。
展开
-
整数反转 LeetCode 7.Reverse Integer
Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note: Assume we are dealing wi...原创 2019-03-08 18:39:24 · 170 阅读 · 0 评论 -
回文数 Leecode 9. Palindrome Number
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121Output: falseExplanati...原创 2019-03-09 16:35:24 · 195 阅读 · 0 评论 -
两数之和 LeetCode 1.Two Sum
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 have exactly one solution, and you may not use the sa...原创 2019-03-07 20:15:18 · 116 阅读 · 0 评论 -
LeetCode 罗马数 13. Roman to Integer
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L 50C 100D ...原创 2019-03-11 19:41:31 · 113 阅读 · 0 评论 -
LeetCode 最长公共前缀 14. Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string “”.Example 1:Input: ["flower","flow","flight"]Output: "f...原创 2019-03-12 14:48:10 · 125 阅读 · 0 评论 -
LeetCode 括号匹配 20. Valid Parentheses
Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of bra...原创 2019-03-13 15:34:32 · 132 阅读 · 0 评论 -
LeetCode 合并两个有序链表 21. Merge Two Sorted Lists
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.Example:Input: 1->2->4, 1->3->4Output: 1-&g...原创 2019-04-17 17:33:08 · 126 阅读 · 0 评论 -
LeetCode 从排序数组中删除重复项 26. Remove Duplicates from Sorted Array
Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this by modifyin...原创 2019-06-21 16:05:29 · 127 阅读 · 0 评论 -
移除元素 Leecode 27. Remove Element
Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the input array...原创 2019-08-06 14:28:18 · 192 阅读 · 0 评论