本文共 526 字,大约阅读时间需要 1 分钟。
条件的算法描述如下:
Given integer m and n where n is odd, for all mxn matrixes that consist of 0 and 1, find the one that has max count of 1s and meets following conditions:Example :
Input: m=2, n=3
Output: [[1,1,1],[1,0,1]]Follow up:
Given another list of ‘blocked’ points. Matrix will set those points to -1 and you cannot change that. Solve the problem again.目前所得结果:
Max=135 如果有更高级解法,请指教~