Tap here to switch tabs
Problem
Submissions

Problem: Double Modular Exponentiation

Double Modular Exponentiation gives four-number entries and a target. Count entries where the first raised by the second is reduced modulo ten, raised by the third, and reduced modulo the fourth to match the target.

Statement

You are given a 2D2\text{D} integer array variables where variables[i] =[ai,bi,ci,mi]= [a_i, b_i, c_i, m_i], and an integer target.

An index i is considered good if it satisfies the following formula:

Return an array consisting of good indices in any order.

Constraints:

  • 1≤1 ≤ variables.length ≤100≤ 100

  • variables[i] == [ai, bi, ci, mi]

  • 1≤1 ≤ ai, bi, ci, mi ≤10³≤ 10³

  • 0≤0 ≤ target ≤10³≤ 10³

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Double Modular Exponentiation

Double Modular Exponentiation gives four-number entries and a target. Count entries where the first raised by the second is reduced modulo ten, raised by the third, and reduced modulo the fourth to match the target.

Statement

You are given a 2D2\text{D} integer array variables where variables[i] =[ai,bi,ci,mi]= [a_i, b_i, c_i, m_i], and an integer target.

An index i is considered good if it satisfies the following formula:

Return an array consisting of good indices in any order.

Constraints:

  • 1≤1 ≤ variables.length ≤100≤ 100

  • variables[i] == [ai, bi, ci, mi]

  • 1≤1 ≤ ai, bi, ci, mi ≤10³≤ 10³

  • 0≤0 ≤ target ≤10³≤ 10³