LeetCode 124: Binary Tree Maximum Path Sum
Not sure why you decided to use std::int_fast64_t over the common int that is used as the type of the tree nodes values.
But since you did, it would be more idiomatic to do at least:
static_cast&lt;std::int_fast64_t&gt;(0);

instead of
(std::int_fast64_t) 0;