⚡️ Tryprepforge
Backend Engineer Senior programming

Given two strings s and t, return the number of distinct subsequences of s which equals t. A subsequence of a string is obtained by deleting some characters without changing the order of the remaining characters. Please implement the following function: ```python def numDistinct(s: str, t: str) -> int: ``` ### Constraints: - 0 <= s.length, t.length <= 1000 - s and t consist of English letters. ### Example 1: Input: s = "rabbbit", t = "rabbit" Output: 3 ### Example 2: Input: s = "abc", t = "abc" Output: 1

Suggested Answer

Practice More Questions Like This

Generate unlimited interview questions with structured answers, code runner, and AI-powered walkthroughs.

No credit card required

More Backend Engineer Interview Prep

Link copied to clipboard