摘要:
public class Solution { public List topKFrequent(int[] nums, int k) { //1. 遍历独立的元素并计数 Map map = new HashMap(); for(int i = 0; i > queue = new PriorityQueue>( ... 阅读全文
摘要:
Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文
摘要:
Given a non-empty array of integers, return the k most frequent elements. For example,Given [1,1,1,2,2,3] and k = 2, return [1,2]. Note: You may assum 阅读全文
摘要:
本月一些事情,没法更新,要到下个月或者下个月底才能继续。 不要找理由!!!!!! 阅读全文
摘要:
Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2- 阅读全文
摘要:
Reverse a singly linked list. 阅读全文
摘要:
Partition List Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You shoul 阅读全文
摘要:
Restore IP Addresses Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example:Given "255 阅读全文
摘要:
Remove Duplicates from Sorted List II Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the 阅读全文
摘要:
Remove Duplicates from Sorted List Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1-> 阅读全文