import java.io.*; import java.lang.reflect.Array; import java.util.Arrays; import java.util.Collection; class test { public static void main (String[] args) throws java.lang.Exception { int[] B = {6,7,8,9,1,2,3,4,5}; int[][] c = {{1, 3, 5, 7},{10, 11…