You are viewing a single comment's thread. Return to all comments →
working java solution
static String gameOfThrones(String s){ // Complete this function int[] temp = new int[26]; for(int i=0;i<s.length();i++) { if(temp[s.charAt(i)-'a']>0) temp[s.charAt(i)-'a']--; else temp[s.charAt(i)-'a']++; } int count=0; for(int i=0;i<26;i++) count+=temp[i]; return count>1? "NO" : "YES"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Game of Thrones - I
You are viewing a single comment's thread. Return to all comments →
working java solution