Company: Hitachi - Codility
Difficulty: medium
Determine whether multiple points moving in 2D space will eventually meet at a single location. Each point moves at a constant speed. The i th point always moves in the direction of the (i+1) th point, and the last point moves toward the first point. As points move, their direction continuously adjusts to keep following their target point. Example locations = [[0, 0], [0, 2], [2, 2], [2, 0]] Each point starts moving toward the next point in the circular array: Point 1 at [0, 0] moves toward Point 2 at [0, 2] Point 2 at [0, 2] moves toward Point 3 at [2, 2] Point 3 at [2, 2] moves toward Point 4 at [2, 0] Point 4 at [2, 0] moves toward Point 1 at [0, 0] As the points move, their paths follow curves because their targets are also moving. The points will eventually meet at [1, 1], so return True . Function Description Complete the function canMeet in the editor with the following parameters: int locations[n][2] : matrix of coordinates where each row is the coordinate of a point Returns bo