Google | Onsite | Find maximum points in a camera view
Anonymous User
1045

Given an array of points in a circle (double) and a camera view width(double), find the maximum number of points that can fit in the camera view in any direction.

The question was kind fo vague and the interviewer was not much helpful on providing any specific insights on the question

I came up with something like this : findMaxPoints(double[] points, double cameraViewLength)

the algo I came up with was based on couting the number of points in the sliding window of length cameraViewLength starting the at 0 and then moving the cameraView = cameraViewLength + points[i] where -1 < i < points.length

Comments (4)