Back to course home
0% completed
Vote For New Content
Question on abs(targetDiff) logic
V F
Dec 2, 2024
if (Math.abs(targetDiff) < Math.abs(smallestDifference) || (Math.abs(targetDiff) == Math.abs(smallestDifference)
Can't this be written as Math.abs(targetDiff) <= Math.abs(smallestDifference)?
0
0
Comments
Comments
On this page
Problem Statement
Solution
Algorithm Walkthrough
Code
Complexity Analysis
Time Complexity
Space Complexity