Refactor rock–paper–scissors for config and ties | Apple Interview Question