Sign in

Photo by Joshua Aragon on Unsplash

From 1st to 24th Dec, Scrimba prepared for us 24 challenges from the JavaScript world. Bellow, I will describe all challenges so far, also with links to my solutions.

1. Candies

n children have got m pieces of candy. They want to eat as much candy as they can, but each child must eat exactly the same amount of candy as any other child. Determine how many pieces of candy will be eaten by all the children together. Individual pieces of candy cannot be split.Example
For n = 3 and m = 10, the output should be candies(n, m) = 9

Rafał Bogacz

Geek, Gamer and Front-End Developer specialized in ReactJS

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store