# leetcode 148. Sort List

## 题目描述

Sort a linked list in O ( n log n ) time using constant space
complexity.

Example 1:

``````Input: 4->2->1->3
Output: 1->2->3->4``````

Example 2:

``````Input: -1->5->3->4->0
Output: -1->0->3->4->5``````

Difficulty: Medium



# leetcode 350. Intersection of Two Arrays II

## 题目描述

Given two arrays, write a function to compute their intersection.

Example 1:

``````Input: nums1 = [1,2,2,1], nums2 = [2,2]
Output: [2,2]``````

Example 2:

``````Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]
Output: [4,9]``````

Note:

• Each element in the result should appear as many times as it shows in both arrays.
• The result can be in any order.

• What if the given array is already sorted? How would you optimize your algorithm?
• What if nums1 ‘s size is small compared to nums2 ‘s size? Which algorithm is better?
• What if elements of nums2 are stored on disk, and the memory is limited such that you cannot load all elements into the memory at once?

Tags: Hash Table, Two Pointers, Binary Search, Sort

Difficulty: Easy

# leetcode 118. Pascal's Triangle

## 题目描述

Given two arrays, write a function to compute their intersection.

Example 1:

``````Input: nums1 = [1,2,2,1], nums2 = [2,2]
Output: [2,2]``````

Example 2:

``````Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]
Output: [4,9]``````

Note:

• Each element in the result should appear as many times as it shows in both arrays.
• The result can be in any order.

• What if the given array is already sorted? How would you optimize your algorithm?
• What if nums1 ‘s size is small compared to nums2 ‘s size? Which algorithm is better?
• What if elements of nums2 are stored on disk, and the memory is limited such that you cannot load all elements into the memory at once?

Tags: Hash Table, Two Pointers, Binary Search, Sort

Difficulty: Easy

# leetcode 242. Valid Anagram

## 题目描述

Given two strings s and t _, write a function to determine if _t is an
anagram of s.

Example 1:

``````Input: _s_ = "anagram", _t_ = "nagaram"
Output: true``````

Example 2:

``````Input: _s_ = "rat", _t_ = "car"
Output: false``````

Note:
You may assume the string contains only lowercase alphabets.

What if the inputs contain unicode characters? How would you adapt your
solution to such case?

Tags: Hash Table, Sort

Difficulty: Easy

# leetcode 179. Largest Number

## 题目描述

Given a list of non negative integers, arrange them such that they form the
largest number.

Example 1:

``````Input: [10,2]
Output: "210"``````

Example 2:

``````Input: [3,30,34,5,9]
Output: "9534330"``````

Note: The result may be very large, so you need to return a string instead
of an integer.

Tags: Sort

Difficulty: Medium

:D 一言句子获取中...