You are playing a card game where the goal is to make straights. Each card in the deck has a number between 1 and 1000000, inclusive. A straight is a sequence of cards with consecutive values. Values do not wrap around, so 1 does not come after 1000000. In addition to regular cards, the deck also contains jokers. Each joker can be used as any valid number (between 1 and 1000000, inclusive).
You will be given a int[] cards containing the cards in your hand. Jokers are represented by 0s, and other cards are represented by their values. Return the number of cards in the longest straight that can be formed using one or more cards from your hand.
|