摘要:
Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Example 2: Example 3: 首先用hashmap扫一遍string,统计频率。按频率排序,将ha 阅读全文
posted @ 2018-11-20 13:30
fatttcat
阅读(125)
评论(0)
推荐(0)
摘要:
Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runti 阅读全文
posted @ 2018-11-20 13:01
fatttcat
阅读(120)
评论(0)
推荐(0)
摘要:
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Example 阅读全文
posted @ 2018-11-20 12:22
fatttcat
阅读(157)
评论(0)
推荐(0)
摘要:
Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element. 阅读全文
posted @ 2018-11-20 12:00
fatttcat
阅读(131)
评论(0)
推荐(0)
摘要:
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
posted @ 2018-11-20 03:07
fatttcat
阅读(128)
评论(0)
推荐(0)
浙公网安备 33010602011771号