Java tutorial
//package com.java2s; import java.util.Map; public class Main { private static Double calculateMagnitude(Map<Object, Integer> map1) { Double sum = 0.0; for (Integer value : map1.values()) { sum += Math.pow(value, 2); } return Math.sqrt(sum); } }