public class Solution { bool[,] tags;//用于标记是否已经访问过,false未访问,true已访问 int[,] records;//用于标记以当前为起点的最长升序列长度(上下左右四向最长的) private int MaxOfFour(int a, int b, int c, int d) { return Math.Max(Math.Max(a, b), Math.Max(c, d)); } private int GetLongestFromPoint(…