1. You can implement the algorithm manually, but the performance can be imagined 2. It is recommended to use PHP built-in functions: http://php.net/manual/zh/func...
Use according to the actual situation Because I saw that the questioner had other problems, I decided that his data structure is like this, and the size increases from top to bottom
1. Convert it into a one-dimensional array and use min and max to find the minimum and maximum respectively
Add a downstairs plan, which is simpler
@jacoob_w
1. You can implement the algorithm manually, but the performance can be imagined
2. It is recommended to use PHP built-in functions: http://php.net/manual/zh/func...
Use according to the actual situation
Because I saw that the questioner had other problems, I decided that his data structure is like this, and the size increases from top to bottom
I adopted the answer so quickly. I personally feel that the solution I adopted is not the best one.