Pergunta de entrevista da empresa JK Tech

Gave one expression, and asked to write code on it. Due to some technical reason, i dint receive this expression in chat window, hence i coded whatever i understood verbally.