Facebook puzzle GridFlip - the problem
The facebook gridflip puzzle :
The puzzle goes like this .. you are given and mxn matrix consisting of integers. Two operations are permitted on the matrix, flip_row and flip_colomn.
Flip_row(x) -> Flips the sign of all numbers in the row
Flip_colomns(x) -> Flips the sign of all numbers in the colomn.
Need to calculate the smallest S with the minimun set of row / colomn operatiosn, where S is defined as the sum of SR(1-m) and SC(1-n).
SR(x) - is defined as the sum of all numbers in row x
SC(x) - is defined as the sum of all numbers in colomn x
Additionally SR(x) for all x=1-m should be posotive & SC(x) for x=1-n should be positive &
The actual puzzle is available here
The solution to this puzzle is available here ..
No comments:
Post a Comment