Amazon Interview Question

some easy coding and bq