条件的算法描述如下:
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:

  1. All 0s are connected;
  2. All 1s are adjacent to at least one 0 (Adjacent includes diagonal line adjacent, 8 directions);
  3. maxtrix[m-1][n/2] = 0.

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
如果有更高级解法,请指教~
摆桶问题

相关文章:

  • 2021-07-13
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-11
  • 2021-10-20
  • 2022-02-15
  • 2021-09-27
  • 2021-10-15
相关资源
相似解决方案