Skip to content

Latest commit

 

History

History

Product of Ranges in An Array

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Given an array A[] of size N. Solve Q queries. Find the product in range [L, R] under modulo P ( P is Prime).

Input : A[] = {1, 2, 3, 4, 5, 6} 
          L = 2, R = 5, P = 229
Output : 120

Input : A[] = {1, 2, 3, 4, 5, 6},
         L = 2, R = 5, P = 113
Output : 7