No Idea!

  • + 2 comments

    I agree with you about the "economy of time" becuase, my solution is below:

    happiness = 0
    for i in range(0,m):    
        happiness += N.count(A[i])
        happiness -= N.count(B[i])
    print(happiness)
    

    For some of the bigger test cases I was getting a time out error.

    @ccjav; your solution is really efficient.