Tap here to switch tabs
Problem
Submissions

Problem: Find Closest Person

med
30 min
Try to solve the Find Closest Person problem.

Statement

You are given three integers x, y, and z representing the positions of Person 11, Person 22, and Person 33 on a number line, respectively.

Both Person 11 and Person 22 move toward Person 33 at the same speed.

Return:

  • 11 if Person 11 reaches Person 33 first.

  • 22 if Person 22 reaches Person 33 first.

  • 00 if both Person 11 and Person 22 reach Person 33 at the same time.

Constraints:

  • 1≤1 \leq x, y, z ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find Closest Person

med
30 min
Try to solve the Find Closest Person problem.

Statement

You are given three integers x, y, and z representing the positions of Person 11, Person 22, and Person 33 on a number line, respectively.

Both Person 11 and Person 22 move toward Person 33 at the same speed.

Return:

  • 11 if Person 11 reaches Person 33 first.

  • 22 if Person 22 reaches Person 33 first.

  • 00 if both Person 11 and Person 22 reach Person 33 at the same time.

Constraints:

  • 1≤1 \leq x, y, z ≤100\leq 100