Driver Code
if __name__ == " _ _ main _ _ " : NEW_LINE INDENT s = " geeksforgeeks " NEW_LINE Q = 2 NEW_LINE l1 = 1 NEW_LINE r1 = 5 NEW_LINE l2 = 4 NEW_LINE r2 = 8 NEW_LINE calculate ( s ) NEW_LINE query ( l1 , r1 ) NEW_LINE query ( l2 , r2 ) NEW_LINE DEDENT