372. Super Pow Medium

@problem@discussion
#Math#Divide and Conquer



1/**
2 * [372] Super Pow
3 *
4 * Your task is to calculate a^b mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array.
5 *  
6 * Example 1:
7 * 
8 * Input: a = 2, b = [3]
9 * Output: 8
10 * 
11 * Example 2:
12 * 
13 * Input: a = 2, b = [1,0]
14 * Output: 1024
15 * 
16 * Example 3:
17 * 
18 * Input: a = 1, b = [4,3,3,8,5,2]
19 * Output: 1
20 * 
21 *  
22 * Constraints:
23 * 
24 * 	1 <= a <= 2^31 - 1
25 * 	1 <= b.length <= 2000
26 * 	0 <= b[i] <= 9
27 * 	b does not contain leading zeros.
28 * 
29 */
30pub struct Solution {}
31
32// problem: https://leetcode.com/problems/super-pow/
33// discuss: https://leetcode.com/problems/super-pow/discuss/?currentPage=1&orderBy=most_votes&query=
34
35// submission codes start here
36
37impl Solution {
38    pub fn super_pow(a: i32, b: Vec<i32>) -> i32 {
39        0
40    }
41}
42
43// submission codes end
44
45#[cfg(test)]
46mod tests {
47    use super::*;
48
49    #[test]
50    fn test_372() {
51    }
52}
53


Back
© 2025 bowen.ge All Rights Reserved.