Search
⌘K

Leetcode 1799. Maximize Score After N Operations

Pair up the 2n integers and assign an operation order to maximize the sum of i * gcd(x,y) over n operations (each operation removes a chosen pair). With n ≤ 7 this is a combinatorial optimization over pairings typically solved via bitmask DP or memoized subset recursion.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.