<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described.
<END_TASK>
<USER_TASK:>
Description:
Minimum operations required to make all Array elements divisible by K
Python3 implementation to find the Minimum number of moves required to update the array such that each of its element is divisible by K ; Function to find the Minimum number of moves required to update the array such that each of its element is divisible by K ; Initialize Map data structure ; Iterate for all the elements of the array ; Calculate the value to be added ; Check if the value equals to 0 then simply continue ; Check if the value to be added is present in the map ; Update the answer ; Print the required result We need to add 1 to maxX because we cant ignore the first move where initially X = 0 and we need to increase it by 1 to make some changes in array ; Driver code

<ASSISTANT_TASK:>
Python Code:
from collections import defaultdict 
 def compute(a , N , K ) : 
	 eqVal = defaultdict(int ) 
 maxX = 0 
 for i in range(N ) : 
	 val = a[i ] % K 
 if(val != 0 ) : 
	 val = K - val 
  if(val == 0 ) : 
	 continue 
  if(val in eqVal ) : 
	 numVal = eqVal[val ] 
 maxX = max(maxX , val +(K * numVal ) ) 
 eqVal[val ] += 1 
  else : 
	 eqVal[val ] += 1 
 maxX = max(maxX , val ) 
   if maxX == 0 : 
	 print(0 ) 
  else : 
	 print(maxX + 1 ) 
   if __name__== "__main __": 
	 K = 3 
 a =[1 , 2 , 2 , 18 ] 
 N = len(a ) 
 compute(a , N , K ) 
 
<END_TASK>
