摘要:
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 阅读全文
posted @ 2020-07-02 10:13
whatyouthink
阅读(99)
评论(0)
推荐(0)
摘要:
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: 阅读全文
posted @ 2020-07-02 10:06
whatyouthink
阅读(86)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2020-07-02 09:53
whatyouthink
阅读(93)
评论(0)
推荐(0)