SHARE
TWEET

Untitled

a guest Jul 17th, 2017 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public String getMostFrequentColor() {
  2.        
  3.         HashMap<String, Integer> mfc = countColors();
  4.         String mfcStr;
  5.         int mfcInt = 0;
  6.         for (Map.Entry<String, Integer> e: mfc.entrySet()){
  7.             if(e.getValue() > mfcInt){
  8.                 mfcStr = e.getKey();
  9.                 mfcInt = e.getValue();
  10.             }
  11.         }      
  12.         return mfcStr;
  13.     }
RAW Paste Data
Top