Here we count the perfect square subarray sum by searching if there is a prefix with sum = ( current prefixSum - ( sq * sq ) )
for i in range ( n ) : NEW_LINE INDENT j = 0 NEW_LINE while prefixSum [ i ] - j * j >= prefixMin : NEW_LINE INDENT if prefixSum [ i ] - j * j in mp : NEW_LINE DEDENT DEDENT