Showing TLE move to zero at the end

import java.util.*;
public class Main {
public static void main (String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int arr[] = new int[n];
for(int i=0;i<n;i++){
arr[i] = sc.nextInt();
}
for(int i =0;i<n;i++){
System.out.println(arr[i]+" ");
}
}
public static void solve(int arr[],int n ){
int ind = 0;
for(int i=0;i<n;i++){
if(arr[i] != 0){
int temp = arr[i];
arr[i] = arr[ind];
arr[ind] = temp;
ind++;
}
}
}
}

why the code is showing tle though i am doing in O(n) character. Please reivew my code