int steps=0;
int find(Node* root)
{
if(!root)
return 0;
int l=find(root->left);
int r=find(root->right);
steps += abs(l) + abs(r);
return (l+r+root->key -1);
}
int distributeCandy(Node* root)
{
find(root);
return steps;
}