Practice Card Flipping Game
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given two 0-indexed integer arrays fronts and backs of length n, where the ith card has the positive integer fronts[i] printed on the front and backs[i] printed on the back. Initially, each card is placed on a table such that the front number is facing up and the other is facing down. You may flip over any number of cards (possibly zero). After flipping the cards, an integer is considered good if it is facing down on some card and not facing up on any card. Return the minimum possible good integer after flipping the cards. If there are no good integers, return 0.
Source: Card Flipping Game on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
fronts = [1,2,4,4,7], backs = [1,3,4,1,3]
2
# Example 2
fronts = [1], backs = [1]
0
Constraints
Related LeetCode Problems
Practice more problems similar to Card Flipping Game.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.