FPEvalRepoPublic/LeetCodeMetaData
0399
1{2 "id": 3234,3 "name": "double-modular-exponentiation",4 "difficulty": "Medium",5 "link": "https://leetcode.com/problems/double-modular-exponentiation/",6 "date": "2023-12-03",7 "task_description": "You are given a **0-indexed** 2D array `variables` where `variables[i] = [ai, bi, ci, mi]`, and an integer `target`. An index `i` is **good** if the following formula holds: `0 <= i < variables.length` `((aibi % 10)ci) % mi == target` Return _an array consisting of **good** indices in **any order**_. **Example 1:** ``` **Input:** variables = [[2,3,3,10],[3,3,3,1],[6,1,1,4]], target = 2 **Output:** [0,2] **Explanation:** For each index i in the variables array: 1) For the index 0, variables[0] = [2,3,3,10], (23 % 10)3 % 10 = 2. 2) For the index 1, variables[1] = [3,3,3,1], (33 % 10)3 % 1 = 0. 3) For the index 2, variables[2] = [6,1,1,4], (61 % 10)1 % 4 = 2. Therefore we return [0,2] as the answer. ``` **Example 2:** ``` **Input:** variables = [[39,3,1000,1000]], target = 17 **Output:** [] **Explanation:** For each index i in the variables array: 1) For the index 0, variables[0] = [39,3,1000,1000], (393 % 10)1000 % 1000 = 1. Therefore we return [] as the answer. ``` **Constraints:** `1 <= variables.length <= 100` `variables[i] == [ai, bi, ci, mi]` `1 <= ai, bi, ci, mi <= 103` `0 <= target <= 103`",8 "test_case": [9 {10 "label": "Example 1",11 "input": "variables = [[2,3,3,10],[3,3,3,1],[6,1,1,4]], target = 2",12 "output": "[0,2] "13 },14 {15 "label": "Example 2",16 "input": "variables = [[39,3,1000,1000]], target = 17",17 "output": "[] "18 }19 ],20 "constraints": [21 "0 <= i < variables.length",22 "((aibi % 10)ci) % mi == target",23 "1 <= variables.length <= 100",24 "variables[i] == [ai, bi, ci, mi]",25 "1 <= ai, bi, ci, mi <= 103",26 "0 <= target <= 103"27 ],28 "python_template": "class Solution(object):\n def getGoodIndices(self, variables, target):\n \"\"\"\n :type variables: List[List[int]]\n :type target: int\n :rtype: List[int]\n \"\"\"\n ",29 "java_template": "class Solution {\n public List<Integer> getGoodIndices(int[][] variables, int target) {\n \n }\n}",30 "metadata": {31 "func_name": "getGoodIndices"32 }33}