2955. Number of Same-End Substrings - Solutions and Explanation | Vultr Docs