think-cell interview question

Interwal map assign function implementation.