Introduction Reinforcement learning is a powerful technique for solving problems. It has been used to…