java.lang.IndexOutOfBoundsException: Index 7, Size:7
问题 I am creating a program that finds the solutions to the eight queens problem by breadth search. My code so far: import java.util.*; import java.lang.*; import java.io.*; public class EightQueens { public static void main(String[ ] args) { ArrayList<List<Integer>> states = new ArrayList<List<Integer>>(); List<Integer> start=new ArrayList<Integer>(); for (int s=0; s<8; s++) { start.add(0); } states.add(start); List<Integer> a = new ArrayList<Integer>(); List<Integer> b = new ArrayList<Integer>(