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
Hint 1Approach
Hint 2Approach
Hint 3Pseudocode
Hint 4Full solution