Solutions for Longest Matrix Path