A local maximum in a 2D array can be defined as a value such that all it\'s 4 neighbours are less than or equal to it, ie, for a[i][j] to be a local maximum,
Above answers just defend a mathematical model.
Which result from a simplistic view of the problem.
If you work as a programmer, you should know what a processor can do. And you should be aware that code runs in a thread. You should wonder if a task is sub-dividable in smaller tasks, so you be able to work it out multi-threaded and get near a 1/total-threads execution speed-up.
The code to do that depends on the language, so I don't provide an example here.