Introduction Reinforcement learning is a type of machine learning that builds algorithms to make decisions…