Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Consecutive Values You Can Make

med
30 min
Try to solve the Maximum Number of Consecutive Values You Can Make problem.

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≤4imes1041 \le n \le 4 imes 10^4

  • 1≤1 \le coins[i] ≤4imes104\le 4 imes 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Consecutive Values You Can Make

med
30 min
Try to solve the Maximum Number of Consecutive Values You Can Make problem.

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≤4imes1041 \le n \le 4 imes 10^4

  • 1≤1 \le coins[i] ≤4imes104\le 4 imes 10^4