Count Special Subarrays with Perfect Square Product

Given an integer array arr of length n, a contiguous subarray is considered special if the product of its elements has an odd number of positive divisors.

Return the total number of speci...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: