Python (Simple DP)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def countSubstrings(self, s, t):\n        n, m = len(s), len(t)\n\n        match = [[0 for _ in range(m+1)] for _ in range(n+1)]\n        matchone = [[0 for _ in range(m+1)] for _ in range(n+1)]\n\n        for i in range(1,n+1):\n            for j in range(1,m+1):\n                if s[i-1] == t[j-1]:\n                    match[i][j] = 1 + match[i-1][j-1]\n                    matchone[i][j] = matchone[i-1][j-1]\n                else:\n                    match[i][j] = 0\n                    matchone[i][j] = 1 + match[i-1][j-1]\n\n        return sum([sum(i) for i in matchone])\n\n\n        \n        \n```
['Python3']