Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Neo is somewhere in the Matrix.

public interface Matrix {
  public int size();
  public int get(int x, int y);
}

You are Morpheus, and your job is to find him.

public class Morpheus {
  public int[] find(Matrix matrix, int neo) {
    // return Neo's x and y coordinates as a two-element array
  }
}

The matrix is controlled by machines, so it is very orderly. It is quadratic, and the following rules hold for all elements:

matrix[x,y] < matrix[x+1,y]
matrix[x,y] < matrix[x,y+1]

And of course, there will be no duplicates of Neo - he is The One.