upgrade(num, user) {
        // lock the node for a given user and unlock all of its descendants no matter who locked it.
        // 1. the given node should be unlocked
        // 2. the given node should have at least one locked node descendant by anyone
        // 3. the given node shouldn't have any locked ancestors    
        if(this.treeHash[num]) return false;
        if(!this.checkDescendants(num)) return false;
        if(!this.checkAncestors(num)) return false;

        // locking the given node
        this.treeHash[num] = user;
        this.unlockDescendants(num);
        return true;
    }
Time O(n) | Space O(n)
@param {number} num 
@param {number} user
@return {boolean}