Some problem solving programming challenges, i have solved. Not all are here, but started adding them slowly.
This project is maintained by chankruze
You have a box of popsicles and you want to give them all away to a group of brothers and sisters. If you have enough left in the box to give them each an even amount you should go for it! If not, they will fight over them, and you should eat them yourself later.
Given the number of siblings that you are giving popsicles to, determine if you can give them each an even amount or if you shouldn’t mention the popsicles at all.
Two integer values, the first one represents the number of siblings, and the second one represents the number of popsicles that you have left in the box.
A string that says ‘give away’ if you are giving them away, or ‘eat them yourself’ if you will be eating them yourself.
3 9
give away
You can give the popsicles to the brothers and sisters because they would each get the same amount, 3.
Language | Solution |
---|---|
C | not available |
CPP | not available |
C# | not available |
Python | available |
Java | not available |
Ruby | not available |
Swift | not available |