Frage im Vorstellungsgespräch bei DXC Technology

Introduction, then one coding question(medium-hard)