Monty hall problem that takes the chosen door as input and if I switch or not. Return if won
function montyHall(chosenDoor: number, switch: boolean): boolean { const winningDoor = Math.floor(Math.random() * 3) + 1; if (chosenDoor === winningDoor) { if (switch) { return false; } return true; } else { if (switch) { return true; } return false; } }