IONOS interview question

Leetcode easy problem, live coding