FastPrepMeeting of Points Moving Toward Initial Successors
Problems/Meeting of Points Moving Toward Initial Successors

Meeting of Points Moving Toward Initial Successors

The Walt Disney Company logoThe Walt Disney Company● MediumNEW GRADPHONE SCREEN
QuestionFunctionExamplesConstraints

Problem statement

Source note: The MLE phone report describes several two-dimensional points moving toward their next point and asks whether they meet. It does not state speeds, target updates, elapsed time, stopping behavior or the meeting predicate. This practice supplies a cyclic array order, fixed initial-successor destinations, one straight-line journey per point during the common interval [0,1], constant per-segment velocity and an all-points-at-one-time decision. Equal journey duration does not imply equal speed. Ongoing pursuit dynamics and a different stopping model remain outside this supplied contract. About 55% of the reported task scope is represented, as an editorial estimate rather than recovered original detail.

Determine whether all the points occupy the same position at one common time during their movement.

For this exercise, the array order defines a cycle. Let P[i] be point i’s initial two-dimensional position, and let its fixed destination be the initial position P[(i+1) mod n]. All points begin at time 0 and complete their own straight-line segment at time 1, using constant velocity on that segment:

position[i](t) = (1-t) * P[i] + t * P[(i+1) mod n], for real 0 <= t <= 1.

Return true if one time t makes every position equal; otherwise return false. Coincident starting positions are allowed. One point already satisfies the condition at time 0. Equal journey durations allow different speed magnitudes for different segment lengths. These fixed-target dynamics, common interval and all-point meeting predicate are supplied practice rules.

Function

meetAtSameTime(points: int[][]) → boolean

Examples

Example 1

points = [[0,0],[4,2]]return = true

At t=1/2 both straight-line trajectories are at [2,1], so the result is true.

Example 2

points = [[0,0],[2,0],[0,2]]return = false

The centroid is [2/3,2/3]. Point 0 remains on y=0 throughout its segment, so all three points cannot meet. The result is false.

Constraints

  • 1 <= points.length <= 200
  • points[i].length == 2
  • -1000000 <= points[i][d] <= 1000000

More The Walt Disney Company problems

  • Find All Paths for a Name in a File SystemPHONE SCREEN · Seen Nov 2026
  • Resizable Array-Backed Integer SetPHONE SCREEN · Seen Sep 2026
  • Shortest Path with Directional Move CostsPHONE SCREEN · Seen Sep 2026
All The Walt Disney Company interview questionsSee The Walt Disney Company hiring insights
Saved
class Solution {
    public boolean meetAtSameTime(int[][] points) {
        // Write your code here
    }
}
Checking account…