A grid is known to have perfect balance if one of its diagonals are all zeros and the other diagonal are all ones ie:

Here are two examples of grids that do not have perfect balance:


A function, perfectBalance, needs to be written to determine if a two-dimensional array of integers has a perfect balance.
It accepts a two-dimensional array of integers as a parameter.
It returns true, if there is a perfect balance and false otherwise.
pre-condition: the array always has one more row than columns. The top right diagonal always has zeros, the bottom left has ones.
post-condition: the array remains unchanged after processing.
Code this function.
This is a good test of your computational thinking!