Python Segment Tree Geeksforgeeks Sql Practice