原创 #16 3Sum Closest
題目鏈接:https://leetcode.com/problems/3sum-closest/ Given an array S of n integers, find three integers in S such that
原创 #22 Generate Parentheses
題目鏈接:https://leetcode.com/problems/generate-parentheses/ Given n pairs of parentheses, write a function to generate
原创 #17 Letter Combinations of a Phone Number
題目鏈接:https://leetcode.com/problems/letter-combinations-of-a-phone-number/ Given a digit string, return all possible l
原创 #19 Remove Nth Node From End of List
題目鏈接:https://leetcode.com/problems/remove-nth-node-from-end-of-list/ Given a linked list, remove the nth node from t
原创 #9 Palindrome Number
題目鏈接:https://leetcode.com/problems/palindrome-number/ Determine whether an integer is a palindrome. Do this without
原创 #15 3Sum
題目鏈接:https://leetcode.com/problems/3sum/ Given an array S of n integers, are there elements a, b, c in S such that a
原创 #11 Container With Most Water
原題鏈接:https://leetcode.com/problems/container-with-most-water/ Given n non-negative integers a1, a2, ..., an, where
原创 #8 String to Integer (atoi)
題目鏈接:https://leetcode.com/problems/string-to-integer-atoi/ Implement atoi to convert a string to an integer. Hint:
原创 #7 Reverse Integer
題目鏈接:https://leetcode.com/problems/reverse-integer/ Reverse digits of an integer. Example1: x = 123, return 321Exam
原创 #21 Merge Two Sorted Lists
題目鏈接:https://leetcode.com/problems/merge-two-sorted-lists/ Merge two sorted linked lists and return it as a new list.
原创 #25 Reverse Nodes in k-Group
題目鏈接:https://leetcode.com/problems/reverse-nodes-in-k-group/ Given a linked list, reverse the nodes of a linked list
原创 #24 Swap Nodes in Pairs
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">題目鏈接:https://leetcode.co
原创 #14 Longest Common Prefix
題目鏈接:https://leetcode.com/problems/longest-common-prefix/ Write a function to find the longest common prefix string am
原创 #18 4Sum
題目鏈接:https://leetcode.com/problems/4sum/ 依次將問題轉化爲3Sum、2Sum問題, 後兩個問題解法見關聯博文。 /** * Return an array of arrays of size *r
原创 #23 Merge k Sorted Lists
題目鏈接:https://leetcode.com/problems/merge-k-sorted-lists/ Merge k sorted linked lists and return it as one sorted list