So I just had a programming test for an interview and I consider myself a decent programmer, however I was unable to meet time constraints on the online test (and there was
You can write your array conditions as rows of a matrix:
[0, 3] -> [1 1 1 0 0]
[2, 4] -> [0 0 1 1 1]
[2, 2] -> [0 0 1 0 0]
Then you write your values as a row vector [143 100 100] and multiply it for the above matrix (left multiplication). The maximum of the result vector is what you are looking for.
For general vector-matrix multiplication there are fast algorithms. Some example can be found there: http://web.stanford.edu/~rrwill/mat-vec-slides.pdf.
If you can assume that the above matrix is sparse (reasonable) then there are very efficient algorithms that perform the multiplication.