The lottery is a popular form of gambling where numbers are drawn to determine the…