Pergunta de entrevista da empresa Barclays

a beautiful house problems. I use python to solve