*Problem: Minerals in a cave
The length of a stalactite or stalagmite is the number of 1s in that column. Given such a picture, devise a O(m log n) algorithm that outputs the following value: max(length of the longest stalactite, length of the longest stalagmite).
[Expected: Pseudocode for your algorithm and a clear English description of what your The algorithm is doing and why it is correct.]*
I am thinking pseudo code but for traversing the grid of pixel I need two loops with time complexity O(n*m) but required is O(mlogn). Any idea how to make more proficient pseudocode
For each column: