GGBUNNY - Editorial

PROBLEM LINK:

Practice
Contest

Author: Suraj Kumar
Tester: Rishabh Gupta
Editorialist: Suraj Kumar

DIFFICULTY:

EASY

PREREQUISITES:

Binary search

PROBLEM:

You are given an array of N inegers and another integer K, you
need to count the total number of elements of the array which are
a positive power of K.

EXPLANATION:

In order to solve this problem first of all store all the positive
powers of K in an Array and then you can search this array for
each of the N integers.
You can search the array using binary search.

AUTHOR’S AND TESTER’S SOLUTIONS:

Author’s solution can be found here.
Tester’s solution can be found here.

RELATED PROBLEMS:

//