Reverse Method Python String Functions Geeksforgeeks Java