Dhioyt
BAN USER
Questions (2)
Comments (5)
Reputation 25
- 0of 2 votes
AnswersGiven an array of integers A. calculate the sum of A[i] %A[j] for all possible i,j pair. return sum%(10^9+7) as an output solve this problem on o(n).
- Dhioyt in India
input :-
A=[1,2,3]
Output:-
5
Explanation:-
(1%1)+(1%2)+(1%3)+(2%1)+(2%2)+(2%3)+(3%1)+(3%2)+(3%3)| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Open Chat in New Window
Open Chat in New Window
0 1 KanpSack
- Dhioyt June 22, 2020