Example 6 a b a s q n 1 2 1 3 2 6 3 4 3 5 2 2 3 2 6
Answer a b
Didn't able to solve this. Please share your approach.