Write a GPU program that counts the number of elements with the integer value p in an 3D array of 32-bit integers.
The program should count the number of elements with p in an 3D array.
You are given an input 3D array input of length N x M x K and integer p.
solve function signature must remain unchangedoutput variable
Input: input [[[1, 2, 3],
[4, 5, 1]],
[[1, 1, 1],
[2, 2, 2]]]
N = 2, M = 2, K = 3
p = 1
Output: output = 5
Input: input [[[5, 10],
[5, 2],
[2, 2]]]
N = 1, M = 3, K = 2
p = 1
Output: output = 0
N, M, K ≤ 1,000input[i], p ≤ 100K = 500, M = 500, N = 500