we know that :- Total Nodes (N) = Internal Nodes(I) + Leaf Nodes(L)
here we are given with :- I = n
so, N = n+L → (1)
we also, know that :- In an k-ary tree the total number of edges are contributed by Internal nodes only and so, the relation between Internal nodes and the number of edges is given by, k * I = (N-1)
=> N = k*n + 1 → (2) , since, I=n(given)
so, from equations 1 and 2, we have, n+L = k*n+1
=> L = k*n – n + 1
=> L = n(k-1)+1 is the answer.