DefaultDict Tutorial

  • + 1 comment

    Hi, just a slight modification, this below also works,

    in place of ,

    for i in range(n[1]):
        print(' '.join(map(str, d[input()])) or -1)
    

    we can do,

    for i in range(n[1]):
        print(*d[input()] or -1)