# two-pointers

1/4ページ

## leetcode 345. Reverse Vowels of a String 反轉字串中的母音字母 python re.findall()、 re.sub() 、”.join()

class Solution: def reverseVowels(self, s): """ :type s: str :rtype: str """ # 相當於一個有限制的字串逆序，只對字串中的母音字母進行逆序。 # Approach #1 # vowels = ('a','e','i','o' […]

## [LeetCode/LintCode] Remove Nth Node From End of List

Problem Given a linked list, remove the nth node from the end of list and return its head. Example Given linked list: 1->2->3->4->5->nu […]

## [LintCode/LeetCode] Remove Element [Two Pointers]

Problem Given an array and a value, remove all occurrences of that value in place and return the new length. The order of elements can be changed, and […]

## [LintCode/LeetCode] Nth to Last Node in List

Problem Find the nth to last element of a singly linked list. The minimum number of nodes in list is n. Example Given a List 3->2->1->5->n […]

## [LintCode/LeetCode] Two Sum

Problem Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of t […]

## [LintCode] Interleaving Positive and Negative Numbers

Problem Given an array with positive and negative integers. Re-range it to interleaving with positive and negative integers. Notice You are not necess […]

## [LintCode/LeetCode] Remove Duplicates from Sorted Array I & II

Remove Duplicates from Sorted Array I Problem Given a sorted array, remove the duplicates in place such that each element appear only once and return […]

## [LintCode/LeetCode] Partition List

Problem Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should prese […]

## [LintCode/LeetCode] 3Sum Closest

Problem Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three i […]

## [LintCode/LeetCode] 4Sum

Problem Given an array S of n integers, are there elements a, b, c, and d in S such that a b c d = target? Find all unique quadruplets in the array wh […]