How to do Unreal Engine matching?

Hello friends. I’m making a game with Unreal Engine and I’m changing it somewhere. There was one mission in Among Us. Matching task, I want to do something similar but YouTube etc. I couldn’t see anything about it. Can you help me or not?

Is this what you’re talking about?
image

It is worth taking as a basis Drag Drop Operation.

When you press the button, keep the wire color, and when you release it, check if it matches what was there before.
In the “OnPaint” function in the widget, you can draw a line from the start of the wires to the cursor or wire end.