Hello, I am a beginner at code chief, I my stuck by this problem that when I try to submit my code it always give me compile-time error I also tried to copy-paste other people solution to find that whether my code has a bug or not but their solutions are also not working on mine .please help
my eg code is this:
can anybody explain where I am lacking?
import java.util.*;
class main{
public static void main (String[] args) {
int n, k, counter=0;
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
k = sc.nextInt();
int[] arr = new int[n];
It’s because you are not entering the input
if you want this code to get no error use try catch block
otherwise write a test case with all the required inputs
for eq write this input and try ,the code will work
5
4
1 2 3 4 5
Sounds like a Codechef bug to me. I remember a while ago (quite a long time ago, actually) the dropdown “Language” box had a bug where the language that you chose wasn’t always the language that Codechef used to compile and run your solution.