![](https://img-blog.csdnimg.cn/20200404081106439.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
LeetCode
Talk is cheap, show me the code.
PengQ1
一枚基本功不扎实的不合格码农
展开
-
LeetCode15-3Sum(C++)
DescriptionGiven an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set mus...原创 2020-04-04 19:06:25 · 215 阅读 · 0 评论 -
LeetCode14-Longest Common Prefix(C++)
DescriptionWrite 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”]...原创 2020-04-04 19:05:28 · 179 阅读 · 0 评论 -
LeetCode13-Roman to Integer(C++)
DescriptionRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol Value I &...原创 2020-04-04 19:03:08 · 202 阅读 · 0 评论 -
LeetCode12-Integer to Roman(C++)
DescriptionRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol Value I &...原创 2020-04-04 19:02:30 · 209 阅读 · 0 评论 -
LeetCode9-Palindrome Number(C++)
DescriptionDetermine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121 Output: true Example 2:Input: -121 Output: fa...原创 2020-04-04 08:08:20 · 177 阅读 · 0 评论 -
LeetCode8-String to Integer (atoi)(C++)
DescriptionImplement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starti...原创 2020-04-04 08:07:28 · 163 阅读 · 0 评论 -
LeetCode7-Reverse Integer(C++)
DescriptionGiven 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 deal...原创 2020-04-04 08:04:12 · 156 阅读 · 0 评论 -
LeetCode6-ZigZag Conversion(C++)
DescriptionThe string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA...原创 2020-04-04 08:03:05 · 229 阅读 · 0 评论 -
LeetCode5 - Longest Palindromic Substring(C++)
Description:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: “babad”Output: “bab”Note: “aba” is also a valid ans...原创 2020-04-03 20:41:47 · 166 阅读 · 0 评论 -
LeetCode4-Median of Two Sorted Arrays(C++)
DescriptionThere are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assume n...原创 2020-04-15 13:26:02 · 160 阅读 · 0 评论 -
LeetCode3-Longest Substring Without Repeating Characters(C++)
DescriptionGiven a string, find the length of the longest substring without repeating characters.Example 1:Input: “abcabcbb”Output: 3 Explanation: The answer is “abc”, with the length of 3. Exam...原创 2020-04-15 13:25:32 · 165 阅读 · 0 评论 -
LeetCode2-Add Two Numbers(C++)
DescriptionYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers ...原创 2020-04-15 13:24:55 · 188 阅读 · 0 评论 -
LeetCode1-Two Sum(C++)
DescriptionGiven 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 us...原创 2020-04-15 13:24:08 · 194 阅读 · 0 评论