Shopee interview question

python, basic programming logic to be written in pseudo code