Living Compiler

what do you think of my theory?

Living Compiler:

Just like how compiler checks for syntax error we can look for logical error. like array index overflow.

Different level of optimization, flattening a problem from O(N^2) to O(N) or O(1) depending upon the problem and using pattern finding or maths.

So as we do DSA or any programming in general we should think like a compiler.

How is my theory?

In short consider constraints like compilers and insights like humans.