A team's record is a string of letters: W win, L loss, D draw. Write WinsLosses(games) to return the wins and the losses at once (draws don't count). An empty string gives 0, 0.
WinsLosses("WLWD")→(2, 1)WinsLosses("")→(0, 0)func WinsLosses(games string) (int, int)package main
func WinsLosses(games string) (int, int) {
wins, losses := 0, 0
for _, g := range games {
// your code here: 'W' adds 1 to wins, 'L' adds 1 to losses
}
return wins, losses
}
Run tries the examples. When they look right, Submit.