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 hintsTopics
More Sprinklr Questions
Create Components With Same ValueHardMinimum Edge Weight Equilibrium Queries in a TreeHardNumber of Great PartitionsHardApply Bitwise Operations to Make Strings EqualMediumApply Operations on Array to Maximize Sum of SquaresHard
View all Sprinklr questions