RJ Softwares interview question

Gave a code to do using props