Question d’entretien chez Kulicke and Soffa

Write a function in Python/C++ for this problem