You are viewing a single comment's thread. Return to all comments →
public static void decentNumber(int n) { String result = "-1"; if(n%3 == 0) { result = "5".repeat(n); } else { for(int i = 5; i <= n; i+=5) { if((n-i)%3 == 0) { result = "5".repeat(n-i) + "3".repeat(i); break; } } } System.out.println(result); }
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and The Beast
You are viewing a single comment's thread. Return to all comments →