• + 4 comments

    I used a dictionary in which, all the numbers in the array are the keys - all with value 1 (to signify that this key exists). Now, when I use dict [3] and it returns to me a 1, this means that 3 exists in the array. Using this trick, I was able to make a linear time program (The longest a case took was 0.04s)
    So yeah, you're right!