Top Useful Tips

Arrays.sort(A, (a, b) -> a[0] - b[0]);

int[] B = A.clone();

PriorityQueue<String> pq= new PriorityQueue<String>(5, (a,b) -> a.length() - b.length());

TreeMap<Integer,String> map = new TreeMap<Integer,String>(); // Balanced Tree.

treeMap.floorKey(2) // find the closest lower key than 2 in the map!