The highly rated answer for this question on GO is excellent still I would like to tell intuition behind the concept
Let n be total number of leaf nodes, intuition is for every 2 leaf nodes there must be a node where separation occurs (that is degree of node 2) to generate two leaf nodes otherwise if no such node exists then there are two trees, so now consider all the node where separation occurred, as leaf node all at same time now for them also separation must occur this will go on till we reach to the 1 i.e n/2 internal, then after considering n/2 as internal their n/4 internal and so on till we reach 1, so n/2+n/4+n/8+...+n/2^log n =n*(1-(1/2)^log(n)-1)/1-0.5= n-1 internal node