We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It is a way of adjusting the value in *a after the sum.
I will try to explain in a simple way.
*a+=*b;//a becomes a+b*b=2*(*b)-(*a);//a+b -b-b = a-b*b=*b>0?*b:-1*(*b);//make positive if b is negative.
NOTE: in the comments I omit the * and change the order of the different in order to make it easier to see. I assume you can understand what it is doing.
Hope this helped.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Pointer
You are viewing a single comment's thread. Return to all comments →
It is a way of adjusting the value in *a after the sum. I will try to explain in a simple way.
NOTE: in the comments I omit the * and change the order of the different in order to make it easier to see. I assume you can understand what it is doing.
Hope this helped.