Walmart Interview Question

Complete two React code in hackerrank, they are not difficult (eventlistener) but will consume time.