Change the signature

Report a typo

Make changes to the signature of the following function so that:

  • the first argument is an integer
  • the second argument is a dictionary with integer keys and sets of string values
  • the third argument is either a boolean or None (may not be passed at all)
  • the return type is a boolean

Please do not change any lines except for the ones that are marked with the TODO notation!

Sample Input 1:

1
1
1 2 3
-1

Sample Output 1:

False
Write a program in Python 3
from typing import ??? # TODO: import constructs you might need

def solution(arg1, arg2, arg3): # TODO: change the signature
if arg3 is None:
return False
return arg1 % 2 == 0 and len(arg2[arg1]) < 3 or arg3
___

Create a free account to access the full topic