minimum path solved