Sort by

recency

|

1282 Discussions

|

  • + 0 comments

    Here is problem solution in python, Java, C++, C and Javascript - https://programmingoneonone.com/hackerrank-chocolate-feast-problem-solution.html

  • + 0 comments

    def chocolateFeast(n, c, m): count = n//c k=count while(k>=m): count += (k//m) k=((k)//m)+ (k%m) return count to hire personal care contract manufacturer

  • + 0 comments

    def chocolateFeast(n, c, m): count = n//c k=count while(k>=m): count += (k//m) k=((k)//m)+ (k%m) return count notes ai

  • + 0 comments

    Here is my easy c++ solution , you can watch the explanation here : https://youtu.be/RZti_qPbiAA

    int chocolateFeast(int n, int c, int m) {
        int result = 0, wrappers = 0;
        while( n >= c){
            result ++;
            wrappers ++;
            n -= c;
            if(wrappers == m){
                result ++;
                wrappers = 1;
            }
        }
        return result;
    }
    
  • + 0 comments

    def chocolateFeast(n, c, m): count = n//c k=count while(k>=m): count += (k//m) k=((k)//m)+ (k%m) return count