Reinforcement Learning (RL) sounds like magic: an agent learns by interacting with an environment, trying…