Java program to implement the above approach
import java . util . * ; import java . util . Collections ; import java . util . Vector ; Vector < Integer > v = new Vector < Integer > ( n ) ; class GFG { static Vector < Integer > find_sequence ( int n ) { Vector < Integer > temp = new Vector < Integer > ( ) ; temp . add ( 1 ) ; temp . add ( - 1 ) ;