Reverse a binary tree using any language.
Represent the tree as nested lists in the form [value, left, right], where an empty child is null; return the same representation after swapping every node's children. Implement def invert_binary_tree(root):, preserving node values and returning null for an empty tree.
Examples: [4, [2, null, null], [7, null, null]] becomes [4, [7, null, null], [2, null, null]]; null remains null. The tree contains at most 500 nodes.
def invert_binary_tree(root):