Maximize Score After N Operations at Sprinklr

Hard57.9% acceptance

This problem has 87.5% frequency at Sprinklr.

Problem Description

You are given `nums`, an array of positive integers of size `2 * n`. You must perform `n` operations on this array. In the `ith` operation **(1-indexed)** , you will: * Choose two elements, `x` and `y`. * Receive a score of `i * gcd(x, y)`. * Remove `x` and `y` from `nums`. Return _the ma...

Read full problem and hints

Topics


More Sprinklr Questions

View all Sprinklr questions