Longest Common Substring Given two strings ‘X’ and ‘Y’, find the length of the longest common substring. Example: abcd bacd Answer - 2 Solutions: Swift O(nm) C++ O(nm) Installation Run make to build and run Swift files. Or you can run .playground file.