How to access an element of a two dimensional array without using the index?