Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is the code I made, and it doesn't pass through the solution even though the outputs looks the same
- def intersect(self,other):
- #return [i for i in self.vals if i in other.vals]
- n=intSet()
- for i in self.vals:
- if i in other.vals: n.insert(i)
- return n
- This code which is modeled after the solution works fine though
- def intersect(self,other):
- #return [i for i in self.vals if i in other.vals]
- n=intSet()
- for i in self.vals:
- if other.member(i): n.insert(i)
- return n
- What's the difference?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement