Capital Numbers interview question

Simple interview questions but worst process