do questions on a platform similar to leetcode, youdao connectivity search.
The
function is placed in the class
instead of using def _ _ init__ at the beginning of the class, an empty dictionary is declared directly
but when you run the problem-solving function later, when you basically do nothing at first,
print to see why there is value in this empty dictionary.
(the outer main function only calls the accountsMerge function)
what"s going on?
and this code point test passed, the dictionary behind the test is still empty, but as soon as it is submitted, it will become a situation in which the dictionary suddenly has a value.
later, puzzled, I created a new def _ _ init__ initialization function, and put father= {} into it before passing
.what on earth is going on? Why does it suddenly have value, or does it just have a system bug?