Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

minperm my solution

$
0
0

please explain me the question not the solution.

this is what i did. i basically rotated the array by 1 and gave it as result. in this case also (Pi!=i)..

package com.company; import java.util.Scanner;

/* * Created by juhi on 24-09-2017./ public class minimum_permutation { private static Scanner sc= new Scanner(System.in);

public static void main(String[] args) {

    int testCaseNo,size,arr;
    testCaseNo=sc.nextInt();
    while(testCaseNo>0)
    {
        size=sc.nextInt();
        fillarray(size);
        testCaseNo--;

    }

}
public static void fillarray(int size)
{ int j=2;
size--;
    while(size >0)
{ System.out.println(j);
j++;
size--;
}
    System.out.println("1");
}

}


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>