Problem 2
Background: Finding out the outlier, an observation that differs significantly from other observations, is a common problem in data science. In reality, for example, when a swarm of
robots are deployed to monitor an area as a team, if a user in the control room notice that the location of a robot falls far away from other robots. The user will immediately know that the robot could be malfunctioning.
Now assume that a user, called Charlie, programmed the robot teams to survey the area following a direct line. Given the location report from the leader robot at the time t , find out the outlier robot, represented by its index. The location report will be imported into your program manually via the command line. The location report is represented as a n-by-2 matrix, where elements in each row i represents the geolocation (x and y coordinates) of robot i .
Example:
Input: [0 1;1 3;2 5;3 8]
Output: 4
# This is because the location reported by the last robot is not following the same line as the rest three robots.