r/dailyprogrammer • • Jul 06 '12
[7/6/2012] Challenge #73 [intermediate]
Write a program that, given an ASCII binary matrix of 0's and 1's like this:
0000000000000000
0000000000000000
0000011001110000
0000001111010000
0000011001110000
0000011011100000
0000000000110000
0000101000010000
0000000000000000
0000000000000000
0000000000000000Outputs the smallest cropped sub-matrix that still contains all 1's (that is, remove all borders of 0's):
01100111
00111101
01100111
01101110
00000011
10100001
9
Upvotes
View all comments
Show parent comment
1
u/sleepingsquirrel Jul 06 '12
Looks like we might need more clarification from the judges. The rules mention removing the border zeros, but how should internal rows/columns with all zeros be handled? For example should the following:
...be returned intact?