Find an N | Java implementation of the above approach ; Function to print the required permutation ; Driver Code
import java . util . * ; class GFG { static void findPermutation ( int N ) { for ( int i = 1 ; i <= N ; i ++ ) System . out . print ( i + " ▁ " ) ; } public static void main ( String [ ] args ) { int N = 5 ; findPermutation ( N ) ; } }