FlairsTech interview question

I was given a problem solving question