https://leetcode.com/problems/number-of-boomerangs/
package com.company;import java.util.*;class Solution { public int numberOfBoomerangs(int[][] points) { int ret = 0; for (int i=0; idMap = new HashMap<>(); long dist; int count; for (int j=0; j > iter = dMap.entrySet().iterator(); while (iter.hasNext()) { int val = iter.next().getValue(); ret += val * (val-1); } } return ret; }}public class Main { public static void main(String[] args) throws InterruptedException { System.out.println("Hello!"); Solution solution = new Solution(); // Your Codec object will be instantiated and called as such: int[][] points = { {0,0},{1,0},{2,0}}; int ret = solution.numberOfBoomerangs(points); System.out.printf("ret:%d\n", ret); System.out.println(); }}