Combinatorial and functional approach of solving matrices under given restrictions. (2021)