Personally found it easier to grasp without using 2 sets of recursions. Goes all the way down and trims when it goes up.

```
def trimBST(self, root, L, R):
if not root:
return None
root.left = self.trimBST(root.left, L, R)
root.right = self.trimBST(root.right, L, R)
if root.val <= R and root.val >=L:
return root
elif root.val > R:
return root.left
elif root.val < L:
return root.right
```