+ 1

How do you solve the code coach Popsicles? I got all of them correct except for one test case.

https://code.sololearn.com/caaav0076J4N/?ref=app

19th May 2022, 12:19 PM
Sun1
7 Respostas
+ 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 ?
19th May 2022, 12:27 PM
Jayakrishna 🇼🇳
+ 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.
19th May 2022, 12:30 PM
Sun1
+ 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?
19th May 2022, 12:39 PM
Jayakrishna 🇼🇳
+ 1
kinda
19th May 2022, 12:47 PM
Sun1
+ 1
Means?
19th May 2022, 1:00 PM
Jayakrishna 🇼🇳
+ 1
Well I understand it it's just that I don't know how to code it.
19th May 2022, 1:06 PM
Sun1
+ 1
Learn about modula operator % 9%3 ? 40%5 ? 15%4 ? For above examples!
19th May 2022, 1:15 PM
Jayakrishna 🇼🇳