Get Data Dependence Sum (Fungible :)

Problem Overview

  • Compute the sum of all day indices x (0 ≤ x < n) such that there exists a positive integer k with floor(n/k) = x.
  • Input: one long integer n. Output: a long integer sum. Constraint: 1 ≤ n ≤ 10^10.
  • Real-world context: models data dependence in Amazon time-series analytics for items across days.
  • From Amazon interviews; a coding interview problem and practice interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: