array hopper to find minimum no of hops to traverse an array