A lottery is a form of gambling in which a prize, typically money, is allocated…