• + 5 comments

    Will your program work for inputs:

    2
    2 4
    

    i. e.
    n=2
    socks = {2, 4}

    I have executed your program on pen and paper. I got 1 as output, but we all know output should be 0.

    Correct me if I am wrong, because I haven't executed it on a Computer.