I was unable to understand the solution therefore I saw a code available on the discussion page. https://ide.codingblocks.com/s/142906?_ga=2.184033573.2020332823.1601006043-1571137155.1594707214 . But could not figure out how the return statement of the query function is working. Please help me out for this.
Could not understand query function
hello @ayusdas2000
if number formed by left node is a and right node is b
then overall number will be ab right?
which is
a * pow( 2, number of digits in right node which is en-mid) + b // shifting a by en-mid position and then adding b to it
i tried the problem and coded it myself, but it is giving all output 0. https://ide.codingblocks.com/s/241307
@ayusdas2000
u can ask new doubt for ur code issue. TA who have solved this problem before will help u.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
Please anyone help me with this question