Oracle Interview Question

find shortest distance between two elements in a 2D array and write test cases for it in testng/junit