Skip to main content
deleted 14 characters in body
Source Link

Heres pseudocode for arrays:

input data in array
find x with for to match first column (legalForBlack[i][0])
   if x matches  legalForBlack[i][0] check if legalForBlack[i][1] matches y
   if not continueyes, else quitcount forit

But there is a better way, when you just want to check if they are in array. Create object Pair with variable x and y, create equals() and hashCode() functions to have unique for each pair (like get hashCode from string xy), place all inputs in Set and then check if given Pair(x,y) is in Set.

Heres pseudocode for arrays:

input data in array
find x with for to match first column (legalForBlack[i][0])
   if x matches  legalForBlack[i][0] check if legalForBlack[i][1] matches y
   if not continue, else quit for

But there is a better way, when you just want to check if they are in array. Create object Pair with variable x and y, create equals() and hashCode() functions to have unique for each pair (like get hashCode from string xy), place all inputs in Set and then check if given Pair(x,y) is in Set.

Heres pseudocode for arrays:

input data in array
find x with for to match first column (legalForBlack[i][0])
   if x matches  legalForBlack[i][0] check if legalForBlack[i][1] matches y
   if yes, count it

But there is a better way, when you just want to check if they are in array. Create object Pair with variable x and y, create equals() and hashCode() functions to have unique for each pair (like get hashCode from string xy), place all inputs in Set and then check if given Pair(x,y) is in Set.

added 316 characters in body
Source Link

Heres pseudocode withfor arrays:

input data in array
find x with for to match first column (legalForBlack[i][0])
   if x matches  legalForBlack[i][0] check if legalForBlack[i][1] matches y
   if not continue, else quit for

But there is a better way, when you just want to check if they are in array. Create object Pair with variable x and y, create equals() and hashCode() functions to have unique for each pair (like get hashCode from string xy), place all inputs in Set and then check if given Pair(x,y) is in Set.

Heres pseudocode with arrays:

input data in array
find x with for to match first column (legalForBlack[i][0])
   if x matches  legalForBlack[i][0] check if legalForBlack[i][1] matches y
   if not continue, else quit for

Heres pseudocode for arrays:

input data in array
find x with for to match first column (legalForBlack[i][0])
   if x matches  legalForBlack[i][0] check if legalForBlack[i][1] matches y
   if not continue, else quit for

But there is a better way, when you just want to check if they are in array. Create object Pair with variable x and y, create equals() and hashCode() functions to have unique for each pair (like get hashCode from string xy), place all inputs in Set and then check if given Pair(x,y) is in Set.

Source Link

Heres pseudocode with arrays:

input data in array
find x with for to match first column (legalForBlack[i][0])
   if x matches  legalForBlack[i][0] check if legalForBlack[i][1] matches y
   if not continue, else quit for