Ad
  • Default User Avatar

    The top voted solution is not random.

    Each row starts with ['A','B','C','D',...]. I suggest adding a test like the one below, which catches the case where at least one column is all the same letter. This happens only 10 out of 4^9 = 262,144 times (0.004% odds) in a truly random array. So the vast majority of the random arrays should still pass with this new test in place.

    function columnTest(res) { 
      for (var col = 0; col < 10; col++) 
        if (res.every(r=>r[col] == res[0][col])) 
          return false; 
      return true;
    }