• + 0 comments

    whats wrong in my program

    import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;

    public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int[]arr= new int[n]; for(int i=0;i

    }
    public static void rotate(int[]arr ,int d)
    {
        int temp;
        for(int i=0;i<d;i++)
        {
            temp=arr[0];
            for(int j=0;j<arr.length-1;j++)
            {
                arr[j]=arr[j+1];
            }arr[arr.length-1]=temp;
        }
    }
    public static void display(int[]arr)
    {
        for(int i=0;i<arr.length;i++)
        System.out.print(arr[i]+" ");
    }
    

    }