摘要:
class Solution { public boolean isStrobogrammatic(String num) { Map<Character, Character> map = new HashMap<>(); map.put('0', '0'); map.put('1', '1'); 阅读全文
摘要:
My PriorityQueue Solution: class Solution { public int[][] intervalIntersection(int[][] firstList, int[][] secondList) { PriorityQueue<int[]> pq1 = ne 阅读全文
摘要:
My Solution 1: class Solution { public ListNode mergeKLists(ListNode[] lists) { PriorityQueue<ListNode> queue = new PriorityQueue<>((a,b)-> a.val-b.va 阅读全文
摘要:
class Solution { public String addStrings(String num1, String num2) { StringBuilder res = new StringBuilder(); int carry = 0; int i=num1.length()-1, j 阅读全文
摘要:
class MovingAverage { Queue<Integer> queue = new LinkedList<>(); int size = 0; double sum=0; public MovingAverage(int size) { this.size = size; } publ 阅读全文
摘要:
class Solution { public boolean isPalindrome(String s) { s= s.toLowerCase(); int i=0, j=s.length()-1; while(i<j){ char a = s.charAt(i); char b = s.cha 阅读全文
摘要:
We use two points to point to two successive nodes, we call them "pre" and "cur" We need to consider 3 situation need to be considered: 1. the inserte 阅读全文