You are viewing a single comment's thread. Return to all comments →
My solution with javascript passed all test
function chocolateFeast(n, c, m) { let jumlahWrapper = Math.floor(n / c); let eaten = jumlahWrapper; while ((jumlahWrapper / m) >= 1) { let wrapp = Math.floor(jumlahWrapper / m); eaten += wrapp; jumlahWrapper = wrapp + (jumlahWrapper % m); } return eaten; }
Chocolate Feast
You are viewing a single comment's thread. Return to all comments →
My solution with javascript passed all test