Bayer Interview Question

Solved two basic algorithm questions