daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class BoggleSolverDriver {
  2.     public static void main(String[] args) {
  3.         BoggleSolver solver = new BoggleSolver();
  4.         Scanner scan = new Scanner(System.in);
  5.         int numTestCases = scan.nextInt();
  6.         for (int k = 0; k < numTestCases; k++) {
  7.             int numWords = scan.nextInt();
  8.             String[] dictionary = new String[numWords];
  9.             for (int i = 0; i < numWords; i++) {
  10.                 dictionary[i] = scan.next();
  11.             }
  12.             int r = scan.nextInt();
  13.             int c = scan.nextInt();
  14.  
  15.             Node[][] boggleBoard = new Node[r][c];
  16.             for (int i = 0; i < r; i++) {
  17.                 for (int j = 0; j < c; j++) {
  18.                     boggleBoard[i] = new Node(scan.next());
  19.                 }
  20.             }
  21.             boggleSolver.printMatchingBoggleWords(dictionary, boggleBoard);
  22.         }
  23.         scan.close();
  24.     }
  25. }
RAW Paste Data
Top