You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, you can have the implementation link here : https://youtu.be/R01NQ4Zt2qA
void decentNumber(int n) { int three = ((3 - (n % 3)) % 3 ) * 5; if(three > n) cout << -1; else cout << string(n - three, '5') << string(three, '3'); cout << endl; }
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 →
Here is my c++ solution, you can have the implementation link here : https://youtu.be/R01NQ4Zt2qA