aryanmain
BAN USER
Comments (7)
Reputation 30
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
1
of 1 vote
findNthInSeries : N int
div4 = div7 = div28 = 0
if N >= 4
let div4 = N >> 2
if N >= 7
let div7 = N / 4
if N >= 28
let div28 = N /28
moveFurther = div4 + div7 - div28
divTest4 = 5 //00..0011
while moveFurther > 0
++N
if N % 28 == 0
{}
else if (N % 7 == 0) or (N & divTest == 0)
++N
return N
Let me know if i am incorrect somewhere
- aryanmain July 25, 2014Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
1
of 1 vote
You need to check first 3 repetition for the pattern. then only check first characters of pattern skipping the remaining. If the next pattern char is same as previous check remaining char ahead if they don't resemble the same pattern you got the erroneous one...
- aryanmain March 29, 2012Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
- aryanmain July 25, 2014