# Question 4: Data Structures [5 Marks]

**Assessment:** FA1 Mock Hands-On (PMIS-FA-1-Generic-Mock)  
**Package / Class:** `dsausingjava.Solution`

---

## Problem Description
An e-commerce system stores coupons in the order they arrive. It also prevents misuse of blocked coupons. Write code in the given Java method to classify coupons based on the rules.

---

## Input Format
- An `ArrayDeque<Integer>` named `allowedQueue` (coupons in sequence)
- An `ArrayList<Integer>` named `blockedList` (blocked coupons)

---

## Rules
For each coupon processed from front to rear:
1. If the coupon:
   - Appears **more than once** in `allowedQueue`, AND
   - Is **not present** in `blockedList`
   - Then:
     - Classify as **"EC"** (Eligible Coupon)
     - Store as `"<coupon>_EC"` in a temporary data structure
2. Otherwise:
   - Classify as **"IC"** (Invalid Coupon)
   - Add `"<coupon>_IC"` directly to output queue
3. After processing all elements:
   - Append all elements from the temporary data structure in **reverse order** to the output queue.

---

## Output Format
- Returns an `ArrayDeque<String>` named `outQueue`

---

## Constraints
- `0 <= number of coupons <= 10`
- `1000 <= coupon value <= 9999`

---

## Sample Input and Output

| `allowedQueue` (Front -> Rear) | `blockedList` (First -> Last) | `tempDataStructure` | `outQueue` (Front -> Rear) |
|---|---|---|---|
| `[4820, 1999, 4820, 2501, 2501, 6000, 3200, 3200]` | `[2501, 7000]` | `{"4820_EC", "4820_EC", "3200_EC", "3200_EC"}` | `["1999_IC", "2501_IC", "2501_IC", "6000_IC", "3200_EC", "3200_EC", "4820_EC", "4820_EC"]` |
| `[3000, 3000, 4200, 4200]` | `[3000, 4200]` | - | `["3000_IC", "3000_IC", "4200_IC", "4200_IC"]` |
| `[4100, 4100, 2750, 2750, 5100, 5100]` | `[9999]` | `{"4100_EC", "4100_EC", "2750_EC", "2750_EC", "5100_EC", "5100_EC"}` | `["5100_EC", "5100_EC", "2750_EC", "2750_EC", "4100_EC", "4100_EC"]` |
