Finding the subarray which is divisible by k

i am using two for loop in java but it is giving TLE
Can you explain any other method