Tap here to switch tabs
Problem
Submissions

Problem: Maximum Elegance of a K-Length Subsequence

Try to solve the Maximum Elegance of a K-Length Subsequence problem.

Statement

You are given a two-dimensional integer array items of length nn and an integer k.

Each item items[i] = [profit_i, category_i] indicates that the item at index i has a profit of profit_i and belongs to category category_i.

Define the elegance of a chosen subsequence of items as:

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Elegance of a K-Length Subsequence

Try to solve the Maximum Elegance of a K-Length Subsequence problem.

Statement

You are given a two-dimensional integer array items of length nn and an integer k.

Each item items[i] = [profit_i, category_i] indicates that the item at index i has a profit of profit_i and belongs to category category_i.

Define the elegance of a chosen subsequence of items as: