My issue
i didnot understand the qstn
My code
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
static void cupcakes(int [] arr){
int min =Integer.MAX_VALUE;
for(int i =0;i<arr.length;i++){
if(arr[i]<min){
min =arr[i];
}
}
for(int i =0;i<arr.length;i++){
if(arr[i]>min){
System.out.println(arr[i]-min);
}else if (arr[i]<min) {
System.out.println(arr[i]);
}else{
System.out.println(arr[i]);
}
}
}
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
int arr[] = new int[t];
for(int i =0 ;i<t;i++){
arr[i] = sc.nextInt();
}
cupcakes(arr);
}
}
Problem Link: MUFFINS3 Problem - CodeChef