Skip to content

Commit

Permalink
chore: day 21
Browse files Browse the repository at this point in the history
  • Loading branch information
shiwangi-07 committed Apr 15, 2024
1 parent 496a47e commit ac8845f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Easy/Day 21/problem.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Alice shuffled a set of cards, each containing a number from 1 to n, with four cards for each number.
After removing one card, she handed you the remaining stack. The i-th card in the stack (where i ranges from 1 to 4n−1) has a number Ai written on it.
Your task is to determine which number Alice took from the original set.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Input:
First line of input contains an integer n (1 <= n <= 10^5).
Second line of input conatains 4n-1 integers.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Output:
Print the missing number.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time Limit: 2 sec
Memory Limit: 1024 MB
24 changes: 24 additions & 0 deletions Easy/Day 21/sample_tc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Sample Input 1:
3
1 3 2 3 3 2 2 1 1 1 2

Sample Output 1:
3

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Sample Input 2:
1
1 1 1

Sample Output 2:
1

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Sample Input 3:
4
3 2 1 1 2 4 4 4 4 3 1 3 2 1 3

Sample Output 3:
2
1 change: 1 addition & 0 deletions Easy/Day 21/solution.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Write your code here.

0 comments on commit ac8845f

Please sign in to comment.