That seems pretty simple and straight forward code, why not write up a C++ code for it quickly?
Seems following are the steps here:
1. Take input for no of test cases
2. Run a loop for that many test cases
3. For each test case, take input parameters count
4. Run a loop for the parameters count
5. if any two input parameters match, you are keeping a result array up to date with that parameter
6. Print all the parameters of the test case that were unique
No idea what exactly you are trying above, but seems straight forward to write up fresh. Try out!
In case, you still don't want to do it yourself (recommended), there are tools like
Cython[
^] that can help. At the end though, you need to make sure if there are any cleanup or adjustments to be done - tools can do some heavy lifting but not 100%