int changing values in nested loops

I’m trying to create a Lottery game where this method prints the name of the player the number of int in common with the Lottery array and somme is the amount of money they won.
When I run the program to check who won the g value only incr…