Absolute Value
EasyAcceptance: N/A
Given an integer n, return the absolute value of n.
Example 1:
Input: n = -5
Output: 5
Explanation: The absolute value of -5 is 5
Example 2:
Input: n = 3
Output: 3
Explanation: The absolute value of 3 is 3
Constraints:
- -1000 <= n <= 1000
Discussion
Please login to view and join the discussion.
Login to ContinueLoading...
Status:Not run yet
Run your code to see results