Costco Wholesale interview question

solve algirithms and write their answers