Tap here to switch tabs
Problem
Submissions

Problem: Number of Pairs of Strings That Concatenate to Target

Number of Pairs of Strings That Concatenate to Target asks you to count ordered pairs of distinct indices whose two digit strings join to form the target string.

Statement

Given an array of digit strings nums and a digit string target, return the number of pairs of indices (i, j) such that i \neq j and the concatenation of nums[i] and nums[j] equals target.

Constraints:

  • 2≤2 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i].length ≤100\leq 100

  • 2≤2 \leq target.length ≤100\leq 100

  • nums[i] and target consist of digits.

  • nums[i] and target do not have leading zeros.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Pairs of Strings That Concatenate to Target

Number of Pairs of Strings That Concatenate to Target asks you to count ordered pairs of distinct indices whose two digit strings join to form the target string.

Statement

Given an array of digit strings nums and a digit string target, return the number of pairs of indices (i, j) such that i \neq j and the concatenation of nums[i] and nums[j] equals target.

Constraints:

  • 2≤2 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i].length ≤100\leq 100

  • 2≤2 \leq target.length ≤100\leq 100

  • nums[i] and target consist of digits.

  • nums[i] and target do not have leading zeros.