Skip to content

Conversation

@VARSHAGURBANI
Copy link

question:-You are given four integers:N ,S,P ,Q . You will use them in order to create the sequence a with the following pseudo-code.

a[0] = S (modulo 2^31)
for i = 1 to N-1
a[i] = a[i-1]*P+Q (modulo 2^31)
--task is to calculate the number of distinct integers in the sequence a .
question asked in various companies interview--solution given in repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant