Problem 3524 · Medium

Find X Value of Array I

Cutting a prefix and a suffix off nums leaves one non-empty contiguous block. For each remainder x below k, count the blocks whose product leaves remainder x when divided by k.

Open the interactive visualisation