What is wrong in this code?

@Par1hsharma
you are getting ArrayIndexOutOfBoundsException . Thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array

there are silly mistakes for index
refer to this corrected code

Why this loop is giving me wrong ans in test case .
for(int k = 1; k<=A[vidx] && k+vidx<A.length; k++)
{
ans = minJumps(A, vidx+k, strg)+1;

			if(ans < minAns && ans!=Integer.MAX_VALUE)
				minAns = ans;
		}
		

		strg[vidx] = minAns;
		
		return minAns;

please go through the code provided .I have mentioned in the comments why the loop is failing

you have to update minAns as ans+1 only if it satisfies the conditions .Also return the val of array not the minAns .
try to debug the code ,you ll get it