You are viewing a single comment's thread. Return to all comments →
public static void decentNumber(int n) { // Write your code here if(n<3||n==4||n==7) System.out.println("-1"); else { for(int i=0;i<=n;i+=5) { String str=""; if((n-i)%3==0) { str="5".repeat(n-i); str+="3".repeat(i); System.out.println(str); return; } } } }
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 →