84. TreeMap으로 단어 개수 세기
다음 Java 프로그램의 실행 결과를 쓰시오.
1import java.util.Map;2import java.util.TreeMap;34public class Main {5public static void main(String[] args) {6String[] words = {"kiwi", "fig", "apple", "pear", "fig", "plum"};7Map<String, Integer> count = new TreeMap<>();8TreeMap<Integer, String> byLen = new TreeMap<>();9for (String w : words) {10count.put(w, count.getOrDefault(w, 0) + 1);11byLen.put(w.length(), w);12}13System.out.println(count);14System.out.println(byLen);15System.out.println(byLen.lastKey() + count.get("fig"));16}17}