Amazon Interview Question

Solve a table test with python