Hackerblocks divisible subarray

please help me i am getting test case 3 as time limit. please solve my doubt…
here is my code


please go thru it.
thanks in advance