Respuesta :

Answer:

I have the code written in c++ but the logic will be the same you just have to change the syntax ( if you're writing different language)

Explanation:

please mark brainliest

Ver imagen Vedant12134
Ver imagen Vedant12134