IONOS Interview Question

Leetcode easy problem, live coding