Sort by

recency

|

1853 Discussions

|

  • + 0 comments

    This problem was created for Python version 2.

    So if you are trying with python 3, it will give you wrong answer something like "-3550055125485641917" . So first change python version to python 2 and then start writing code.

    Note: use raw_input() function to take input in python 2

  • + 0 comments

    Use Python 2 for the solution! The question is giving correct solution only when we are using python 2 maybe the question was made using it : )

  • + 0 comments

    why its showing wrong answer

  • + 0 comments

    Yep, getting -3550055125485641917 as hash(t) output for given 1, 2 input on Python 3.12 using my code based on list comprehension as well as crosschecking with map() based solution. Sadly, nobody would ever use legacy Python2 nowadays ;-(, last time I remember was on Jython, but feels like eternity ...

  • + 0 comments

    use python 2 with this solution:

    if name == 'main':

    n = int(raw_input())

     elements = tuple(map(int, raw_input().split()))
    

    print hash(elements)