[TREE - Linkedin] right most node in complete binary tree

Problem - Given a binary tree how to find the position of right most node in last level of complete binary tree?
e.g - [18,15,30, 40,50,100,40,8,7,9,null,null,null,null,null]

image

Ans. - 9

Can anyone provide me solution and explanation to this problem?

Comments (2)