JAVA_Binary Watch_LeetCode 401 풀이 class Solution { public List<String> readBinaryWatch(int turnedOn) { List<String> time = new ArrayList<>(); for (int h=0; h<12; h++){ for (int m=0; m<60; m++){ if (Integer.bitCount(h * 64 + m) == turnedOn) time.add(String.format("%d:%02d", h, m)); } } return time; } } * 출처 Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com...
#BinaryWatch_LeetCode401
#JAVA
#JAVA_BinaryWatch
#JAVA_BinaryWatch_LeetCode401
#JAVA_LeetCode401
원문링크 : JAVA_Binary Watch_LeetCode 401