VinBrain interview question

HackerRank: Coding Interview related to React.js