The Question
CodingSum of Sortable Partition Sizes
Given an integer array `nums` of length `n`, a positive integer `k` is defined as 'sortable' if `k` is a divisor of `n` and the array can be sorted into non-decreasing order by partitioning it into consecutive subarrays of length `k` and independently rotating each subarray any number of times. Write a function to return the sum of all such sortable integers `k`. Your solution should handle large inputs efficiently and account for duplicate elements.
Python3
Hashing
Prefix Sum
Mathematics
Sorting