摘要:
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
摘要:
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. Example: Input: 阅读全文
摘要:
Given an array of integers arr, replace each element with its rank. The rank represents how large the element is. The rank has the following rules: Ra 阅读全文