FastPrepFastPrep
Problem Brief

Count Powers of K (MLE)

INTERNOA

Given an array and a value k, find the count of numbers in the array that are powers of k. For example, if arr = [11, 121, 10] and k = 11, the result would be 2.

1Example 1

Input
arr = [11, 121, 10], k = 11
Output
2
Explanation
🐿️
public int countPowersOfK(int[] arr, int k) {
  // write your code here
}
Input

arr

[11, 121, 10]

k

11

Output

2

Sign in to submit your solution.