I am facing some problem in this function. I am unable to understand the math behind the percentage…

What is meant by this particular line,

“The chart should show the percentage spent in each category passed in to the function. The percentage spent should be calculated only with withdrawals and not with deposits.” - (This is quoted from the prompt)

Just give me the hint of the math, I hope i will be able to solve it

Thanks it advance…