Netskope interview question

Problem from leet code blind 75