Absolute Value
Sat Feb 05 2022 12:16:24 GMT+0000 (Coordinated Universal Time)
Saved by @Uttam #java #absolutevalue #mathematics #gfg #geeksforgeeks
1. Absolute Value You are given an integer I, find the absolute value of the integer I. Example 1: Input: I = -32 Output: 32 Explanation: The absolute value of -32 is 32. Example 2: Input: I = 45 Output: 45 Explanation: The absolute value of 45 is 45 itself. Your Task: You don't need to read input or print anything. Your task is to complete the function absolute() which takes an integer I as an input parameter and return the absolute value of I. Expected Time Complexity: O(1) Expected Auxiliary Space: O(1) Constraints: -10^6 <= I <= 10^6
https://practice.geeksforgeeks.org/problems/absolute-value/1/?track=DSASP-Mathematics&batchId=190
Comments