Skip to content
Advertisement

Tag: instance-variables

instance variable difference (Python)

I have 2 questions about the solutions below. Below is my answer (Solution 1) for this question of leetcode: https://leetcode.com/problems/distribute-coins-in-binary-tree/ Quesion1 I was wondering why below does not work. What is the difference between the variable ans of Solution 1 and Solution 2? Because changes on grid variable below (Solution 3) is accumulated and affects all each recursions, I thought

Advertisement