Problem Brief
Circles Relationship
FULLTIMEOA
See IBM online assessment and hiring insights
Two circles on a Cartesian plane, A and B, are each defined by three descriptors:
Circles A and B will both be centered either on the X-axis (i.e., YA = 0 and YB = 0, or on the Y-axis (i.e., XA = 0 and XB = 0), but not both.
A pair of circles (A and B) will have one of the following relationship types:
Function Description
Complete the function circles in the editor.
circles has the following parameter(s):
string circlePairs[n]: each string contains six space-separated integers. The first three integers are X, Y, and R for circle A, and the last three are X, Y, and R for circle B.
Returns
string[n]: each string is the relation between the circles described in circlePairs[i]
1Example 1
Input
circlePairs = ["3 0 10 5 0 3", "0 1 4 0 1 5"]
Output
["Disjoint-Inside", "Concentric"]
Explanation
1. The circles are Disjoint-Inside.
Circle A is centered at (3, 0) and extends 10 units along the x-axis from -7 to 13.
Circle B is centered at (5, 0) and extends 3 units along the x-axis from 2 to 8.
2. The circles are Concentric.
Circle A is centered at (0, 1) and extends 4 units along the y-axis from -3 to 5.
Circle B is centered at (0, 1) and extends 5 units along the y-axis from -4 to 6.
Constraints
Limits and guarantees your solution can rely on.
- 1 ≤ n ≤ 5000
- 0 ≤ X,Y,R ≤ 5000