Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Consecutive Values You Can Make

Maximum Number of Consecutive Values You Can Make asks you to use subsets of a positive-integer array to form every value from zero through the longest consecutive range, then return its length.

Statement

Given an integer array coins of length n, return the maximum number of consecutive integer values you can form starting from 00.

You can select any subset of elements from coins and sum their values to form an integer value.

Constraints:

  • coins.length =n= n

  • 1≤n≤4×1041 \le n \le 4 \times 10^4

  • 1≤1 \le coins[i] ≤4×104\le 4 \times 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Consecutive Values You Can Make

Maximum Number of Consecutive Values You Can Make asks you to use subsets of a positive-integer array to form every value from zero through the longest consecutive range, then return its length.

Statement

Given an integer array coins of length n, return the maximum number of consecutive integer values you can form starting from 00.

You can select any subset of elements from coins and sum their values to form an integer value.

Constraints:

  • coins.length =n= n

  • 1≤n≤4×1041 \le n \le 4 \times 10^4

  • 1≤1 \le coins[i] ≤4×104\le 4 \times 10^4