Daily Challenge (245 Part Series)
John bought potatoes: their weight is 100 kilograms. Potatoes contain water and dry matter.
The water content is 99 percent of the total weight. He thinks they are too wet and puts them in an oven - at low temperature - for them to lose some water.
At the output, the water content is only 98%.
What is the total weight in kilograms (water content plus dry matter) coming out of the oven?
He finds 50 kilograms and he thinks he made a mistake: "So much weight lost for such a small change in water content!"
Can you help him?
p0 - initial percent of water-
w0 - initial weight -
p1 - final percent of water -
potatoes should return the final weight coming out of the oven w1 truncated as an int.
potatoes:(99, 100, 98) --> 50
Want to propose a challenge idea for a future post? Email email@example.com with your suggestions!
Need to keep up with a fast-moving software industry?