Python Segment Tree Geeksforgeeks C