My solution unlike the answer you indicate in your post assumes a general tree.
The idea is to recursively traverse all children. When we reach a leaf node we know it cannot be a node with the maximum nodes possible and return -1. If the current node is an internal node then we have two possibilities: either there is a full node in one of its subtrees, or the node itself is full. So we recursively check each subtree. Upon return from a recursive call, we check if its return value is -1 or a positive one equal to the height of the full node. -1 means we have not found any.
When we finish scanning of all subtrees of the current node we must check if we found any full node in one of its subtrees. If found we return its height. If not we check whether the current node is full. If it is full we return the current height, else we return -1, i.e., we failed to find. The following pseudocode implements this idea.
Search(node, height)
if node is leaf
return -1
#search in subtrees
max_height = -1
loop on node's children |child|
hgt = Search(child, height+1)
if max_height < hgt
max_height = hgt
end-loop
if max_height == -1 #no full node found in any of subtrees
if node's children count == MAX_NODES_POSSIBLE
return height
else
return -1
else
return max_height
end-Search
Initially we call Search(root, 0)
.