How can I verify if the winningConditions are present in chosenNumbers? The chosenNumbers array is of varying lengths and consists of a mix of numbers. For example, one of the winning conditions is [0, 3, 6], but there is also the number 2 included. How can I effectively check for this condition? I would like to return true only if the winning condition array [0, 3, 6]
contains the same numbers as the chosen numbers [0, 2, 3, 6]
, excluding the number 2 since it falls outside the scope. I hope my explanation is clear.
private chosenNumbers [0, 2, 3, 6]
private winningConditions = [
[0, 1, 2],
[3, 4, 5],
[6, 7, 8],
[0, 3, 6],
[1, 4, 7],
[2, 5, 8],
[0, 4, 8],
[2, 4, 6],
];