Kulicke and Soffa interview question

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