Find Closest Number to Zero Problem
Find Closest Number to Zero Problem — ExecCode Easy DSA Practice
Solve the Find Closest Number to Zero problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.
Description Given an integer array nums of size n, return the number with the value closest to 0 in nums. If there are multiple answers, return the number with the largest value. Examples Example 1 Input: nums = [-4,-2,1,4,8] Output: 1 Explanation: The distance from -4 to 0 is |…
Practice Find Closest Number to Zero free on ExecCode. Browse more ExecCode DSA problems.