kth smallest in 2d array