You are viewing a single comment's thread. Return to all comments →
Java 15
public static String canConstruct(List<Integer> a) { int res = 0; for (Integer i : a) { char[] charArray = String.valueOf(i).toCharArray(); for (char c : charArray) { res += Integer.parseInt(Character.toString(c)); } } return (res % 3 == 0)? "Yes" : "No"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Constructing a Number
You are viewing a single comment's thread. Return to all comments →
Java 15