Tap here to switch tabs
Problem
Submissions

Problem: Closest Divisors

med
30 min
Try to solve the Closest Divisors problem.

Statement

Given an integer num, find two integers whose product is equal to num +1+ 1 or num +2+ 2 such that the absolute difference between the two integers is minimized.

Return the two integers in any order.

Constraints:

  • 1≤1 \leq num ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Closest Divisors

med
30 min
Try to solve the Closest Divisors problem.

Statement

Given an integer num, find two integers whose product is equal to num +1+ 1 or num +2+ 2 such that the absolute difference between the two integers is minimized.

Return the two integers in any order.

Constraints:

  • 1≤1 \leq num ≤109\leq 10^9