Armakuni interview question

Write a simple algorithm with TDD approach