Sherlock and The Beast

  • + 0 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;
    }