Anyone please Explaing whats wrong in code

What should I save in segment tree