MUMUBugMerge SortThe principle of merge sort is quite simple.Take advantage of the fact that combining two sorted arrays has O(n) time complexity,using…Dec 9, 2021Dec 9, 2021
MUMUBug1217. Minimum Cost to Move Chips to The Same Position(easy)We have n chips, where the position of the ith chip is position[i].Dec 6, 2021Dec 6, 2021
MUMUBugSelection SortThe principle of selection sort is — select the smallest value in unsorted array, and then swap it with the left most value in this…Dec 6, 2021Dec 6, 2021
MUMUBugInsertion SortInsertion sort is a little bit more efficient than bubble sort in practice.Dec 6, 2021Dec 6, 2021
MUMUBugBubble SortCompare adjacent elements and swaps them if they are in the wrong order.Dec 3, 2021Dec 3, 2021
MUMUBug152. Maximum Product Subarray(Medium)Given an integer array nums, find a contiguous non-empty subarray within the array that has the largest product, and return the product.Dec 3, 2021Dec 3, 2021