You are given two 8-bit unsigned integers a and b. You must compute a - b, and also detect if underflow occurred (i.e., when b > a).
Return:
Example-1
Input: a = 100, b = 50
Output: diff = 50, carry = 0
Example-2
Input: a = 10, b = 20
Output: diff = 246, carry = 1
Example-3
Input: a = 0, b = 0
Output: diff = 0, carry = 0
Input
100 50
Expected Output
diff = 50, carry = 0