NeetCode #747LC-1639Hard2-D Dynamic Programming
← Back to All Problems

#747 · #1639 · Number of Ways to Form a Target String Given a Dictionary(通过给定词典构造目标字符串的方案数)

📌 Problem Statement & Constraints

Given a list of equal-length words and a target string, count the number of ways to form target by picking, for each position k, a column index that strictly increases and a character in that column equal to target[k]. Return the count modulo 1e9+7. Constraints: 1 <= words.length <= 1000, 1 <= words[i].length <= 1000, 1 <= target.length <= 1000, and all words have the same length.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!