I have one problem in List and LinkedHashSet in java
// Java Program
import java.util.*;
public class always_edit_this {
public static void main(String [] args)
{
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
List<String> a = Arrays.asList(sc.nextLine().split(" "));
LinkedHashSet <String> ans = new LinkedHashSet<>(a);
System.out.println(ans);
}
}
// In the above program
I can get the integer value input but, After getting that It terminates the program and Don't get a List input I don't know why anybody can solve this
Does any anybody can solve this