Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String getHealthiestSalad() {
- int calories = Integer.MAX_VALUE;
- String healthiestSalad = "";
- for (Map.Entry<String, Salad> salad : data.entrySet()) {
- if (calories > salad.getValue().getTotalCalories()) {
- calories = salad.getValue().getTotalCalories();
- healthiestSalad = salad.getKey();
- }
- }
- return healthiestSalad;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement