Description Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You […]

## 序列和 – NowCoder IDE Try Out

Description 题目描述 给出一个正整数N和长度L，找出一段长度大于等于L的连续非负整数，他们的和恰好为N。答案可能有多个，我我们需要找出长度最小的那个。例如 N = 18 L = 2：5 + 6 + 7 = 183 + 4 + 5 + 6 = 18都是满足要求的，但是我们输出更短的 5 6 […]

## 3Sum – #15 LeetCode

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 […]

## Longest Common Prefix – #14 LeetCode

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 […]

## Roman to Integer – #13 LeetCode

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For […]

## Integer to Roman – #12 LeetCode

Description Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 […]

## Container With Most Water – #11 LeetCode

Description Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and […]

## Regular Expression Matching – #10 LeetCode

Description Given an input string (s) and a pattern (p), implement regular expression matching with support for ‘.’ and ‘*’. ‘.’ Matches any single character. ‘*’ Matches zero […]

## Palindrome Number – #9 LeetCode

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: […]

## String to Integer (atoi) – #8 LeetCode

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, […]