11. Absolute Difference
Foundation1000 ms256 MBSolved by 0%
Read two integers and print the absolute difference between them, that is, how far apart they are, always as a non-negative number.
Constraints - `-1000000000 ≤ a, b ≤ 1000000000`
Input
A single line containing two integers, separated by a space.
Output
Print one integer, the absolute difference, always non-negative.
Input9 4
Output5
Notehas the larger value first
Input4 9
Output5
Notehas the larger value second, and must give the same answer
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.