Matlab vs Java

The first thing I tried yesterday was to translate the Matlab function for verifying a Sudoku puzzle into Java. That was the first time I realized how easy it was to code in Matlab compared to Java.

As a comparison, let's look the codes. For matlab, to check for duplicate values , here's the code:
k = find(A(i,:) == j);

It's just a single line and I only need to check the length of k next to determine whether duplicate values exist or. For Java, I have write a loop to get the desired result.

int[] count = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int value = 0;
// check for duplicate values
for(int i = 0; i <>
value = cells[i];
count[value] += 1;
if(value != 0 && count[value] > 1) {
return true;
}

Conclusion: Matlab beats Java with a resounding victory. Of course, that only applies when it comes to ease of programming.