Query Bits using Segment Trees with Lazy Propagation

I have watched the hint video and performed steps accordingly. I pass the example test case but get Wrong Answer for other test cases.

I have commented my code at important steps as described in the videos.

Question:
https://online.codingblocks.com/app/player/65729/content/154708/5071/code-challenge

My Solution:

In line 62 you should rather return
ans= left_answer * 2^(end-mid)+right_answer or
st[node] = (st[node * 2 + 1] * pow(2, en - mid, mod) % mod + st[node * 2 + 2]) % mod
You can check out this code for reference.