StoneX Interview Question

Suitable pairs coding question arrange the pairs as per condition?