Question: Write a method called is1to1 that accepts a map whose keys and values are strings as its parameter and returns true if no two keys
Write a method called is1to1 that accepts a map whose keys and values are strings as its parameter and returns true if no two keys map to the same value. For example, {Marty=206–9024, Hawking=123–4567, Smith=949–0504, Newton=123–4567} should return false, but {Marty=206–9024, Hawking=555–1234, Smith=949–0504, Newton=123–4567} should return true. The empty map is considered 1-to-1 and returns true.
Step by Step Solution
3.30 Rating (147 Votes )
There are 3 Steps involved in it
public static boolean isltol Map map ... View full answer
Get step-by-step solutions from verified subject matter experts
