Problem 396 · Medium

Rotate Function

Calculate the sum of all F(k) where F(k) is the sum of i*nums[(i+k) % len] for all i.

Open the interactive visualisation