
LeetCode
Talk is cheap, show me the code.
PengQ1
一枚基本功不扎实的不合格码农
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode15-3Sum(C++)
Description Given 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 · 282 阅读 · 0 评论 -
LeetCode14-Longest Common Prefix(C++)
Description 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”]...原创 2020-04-04 19:05:28 · 246 阅读 · 0 评论 -
LeetCode13-Roman to Integer(C++)
Description Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I &...原创 2020-04-04 19:03:08 · 308 阅读 · 0 评论 -
LeetCode12-Integer to Roman(C++)
Description Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I &...原创 2020-04-04 19:02:30 · 325 阅读 · 0 评论 -
LeetCode9-Palindrome Number(C++)
Description Determine 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 · 281 阅读 · 0 评论 -
LeetCode8-String to Integer (atoi)(C++)
Description Implement 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 · 234 阅读 · 0 评论 -
LeetCode7-Reverse Integer(C++)
Description Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 120 Output: 21 Note: Assume we are deal...原创 2020-04-04 08:04:12 · 232 阅读 · 0 评论 -
LeetCode6-ZigZag Conversion(C++)
Description The 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 N A...原创 2020-04-04 08:03:05 · 279 阅读 · 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 · 237 阅读 · 0 评论 -
LeetCode4-Median of Two Sorted Arrays(C++)
Description There 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 · 208 阅读 · 0 评论 -
LeetCode3-Longest Substring Without Repeating Characters(C++)
Description Given 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 · 241 阅读 · 0 评论 -
LeetCode2-Add Two Numbers(C++)
Description 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 contain a single digit. Add the two numbers ...原创 2020-04-15 13:24:55 · 269 阅读 · 0 评论 -
LeetCode1-Two Sum(C++)
Description 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 us...原创 2020-04-15 13:24:08 · 262 阅读 · 0 评论