Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public String getHealthiestSalad() {
  2. int calories = Integer.MAX_VALUE;
  3. String healthiestSalad = "";
  4. for (Map.Entry<String, Salad> salad : data.entrySet()) {
  5. if (calories > salad.getValue().getTotalCalories()) {
  6. calories = salad.getValue().getTotalCalories();
  7. healthiestSalad = salad.getKey();
  8. }
  9. }
  10. return healthiestSalad;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement