I'll keep the algorithm solution that are worth to be kept with my solutions.
below is giving the executor script a permission.
chmod 777 ./validate.sh
chmod 777 ./validateSingle.sh
./validate.sh {folderName} [verbose]
./validate.sh FormingMagicSquares verbose
$ ./validate.sh FormingMagicSquares verbose
testing FormingMagicSquares
---------------------------
==> (O) case1 passed!
==============
case1 output:
1
==============
case1 answer:
1
==============
---------------------------
==> (O) case2 passed!
==============
case2 output:
21
==============
case2 answer:
21
==============
---------------------------
==> (O) case3 passed!
==============
case3 output:
16
==============
case3 answer:
16
==============
---------------------------
$ ./validate.sh FormingMagicSquares
testing FormingMagicSquares
---------------------------
==> (O) case1 passed!
---------------------------
==> (O) case2 passed!
---------------------------
==> (O) case3 passed!
---------------------------
Interesting algorithm which find unbalance factor. It uses window moving algorithm and unbalance factor extract algorithm here
Also interesting zigzag pattern algorithm. it handles 2D arrays. here
more Forming Magic square with minimum changes. Simply create magic square, and make 8 variants. And Compare with test cases suming all the difference to find minimum differences.
check if a matrix is alphabetically ascending both horizontally and vertically.
more if a tree with fileSize is given, find the best cut to be the most balanced.