MathWorks Interview Question

Discuss how to implement diff algorithm.