I need help in building the logic of the task i am mentioning in the image. Can anyone help me building the complete code? Javascript logic building regarding the image i have posted and need to crack it as soon as possible. enter image description here