r
BAN USER
Comments (5)
Reputation -5
Page:
1
Comment 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.
-1
of 1 vote
i can think of the below; let me kow if u see issues
1. Let the paper size is m x n
2. Small paper piece dimention: sm x sn
3. compute: pieces = modulus( m/sm ) * modulus( n/sn )
4. compute: pieces2 = modulus( m/sn ) * modulus( n/sm )
5. return max ( pieces2, pieces)
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
I can think of the below
1. Have 2 windows; and keep them 2 digits apart
2. Each window has 2 pointers; max, Min, and variable: Sum as sum btw max, min pointers
3. get sum of left window and right; if they are same print it out
4. Slide the windows by a digit to right.
5. On slide we know the old index of min; subtract the value from the Sum; we konw the new index of max so add that value to the Sum
the complexity should be o(n)
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Multiple samples of Thread dumps should help. Looking at the dump u can know what all threads are waiting and on what object.
- r November 09, 2014