public static int getIndex(int[] arr,int key)
{
for(int i=0;i<arr.length-1;i++)
{
if(arr[i]==key)
return i;
else
return -1;

}
}}