title: detecting duplicate in columns of a 2D array
body: <p>I would like an algorithm that goes through a 2D array and guarantees that each column has all distinct numbers. If a dupe is found in the array it should be replaced with a random number. The random number must also preserve the uniqueness.  </p>
  
  <p>If we put a random number, the whole column, should be unique.</p>
  
  <p>is it possible to get an O(N) solution too ?</p>