標籤:: Sort
Largest Number
Largest NumberGiven a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330. Note: The result
Insertion Sort List
Insertion Sort ListSort a linked list using insertion sort. 提示 解題應用 LinkedList Pointer Sort Insertion Sort Default:12345678910/** * Definition for singly-linked list. * type ListNode stru
Sort Colors
Sort ColorsGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the
Merge Intervals
Merge IntervalsGiven a collection of intervals, merge all overlapping intervals. For example:12Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18]. 提示 解題應用 Array Array/Slice Sort In
Intersection of Two Arrays
Intersection of Two ArraysGiven two arrays, write a function to compute their intersection. ###For Example: 1Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each element in the result
Intersection of Two Arrays II
Intersection of Two Arrays IIGiven two arrays, write a function to compute their intersection. For Example:1Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. Note: Each element in the resul
Palindrome Linked List
Palindrome Linked ListGiven two strings s and t, write a function to determine if t is an anagram of s. For example:12s = "anagram", t = "nagaram", return true.s = "rat"