pratik-choudhari / AlgoCode

Welcome everyone!🌟 Here you can solve problems, build scrappers and much more💻
https://github.com/pratik-choudhari/AlgoCode
MIT License
131 stars 166 forks source link

Bit array #405

Closed pratik-choudhari closed 3 years ago

pratik-choudhari commented 3 years ago

Feature ✅

Description

Given four integers N,S,P,Q, calculate the number of distinct elements in array a calculated using 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) 

Example

Input: 3 1 1 1 Output: 3

Contributors are supposed to mention their coding language while asking for assignment

kitteltom commented 3 years ago

@pratik-choudhari I can do that in Java. Can you please assign it to me?

anshika0207 commented 3 years ago

@pratik-choudhari can you assign this to me? I can code in c++.

namita2310 commented 3 years ago

@pratik-choudhari can you assign this to me? I can code in c.

anu-ragi commented 3 years ago

hi, i can try in javascript.. can u pls assign..

codeit-dotcom commented 3 years ago

can you assign this to me ? i can code in c++

ghost commented 3 years ago

@pratik-choudhari can you please Assign this to me in Python.