+ 1
How do you solve the code coach Popsicles? I got all of them correct except for one test case.
7 odpowiedzi
+ 1
Sun1 Task is "distribute pipesiples to siblings equally without remainings". Possible print "Give away" Else print "eat them yourself"
But what is mean by sib <= 3 in code ?
+ 1
sib is sibling and if there are less siblings to split the popsicles with then it outputs eat them yourself! that's what sib<=3 is and is just so happen to be correct for a test case so I added the = symbol.
+ 1
It accidentally passing..
Ex : sib = 3, pip = 9 then distribute all, 3 each
If sib = 5, pip = 40 then distribute all, 8 each
If sib = 4, pip = 15 then you can't distribute since 4*3=12 , 15-12=3 remains, you can distribute 3 to 4 siblings each same.
Got the logic?
+ 1
kinda
+ 1
Means?
+ 1
Well I understand it it's just that I don't know how to code it.
+ 1
Learn about modula operator %
9%3 ?
40%5 ?
15%4 ? For above examples!