[algogeeks] coding round question

2011-10-30 Thread vikas kumar
There  are a number of integer ranges say [ L, R]i denoting left and
right of segment i, lets says we are given K such segments and we
define one operation as move which makes our chosen segment to move
either +1 or -1 so after
move(i, +1) segment i will be [L+1, R+1]. There are some particular
numbers which are made using 4 or 7 : any cobination of 4 and 7 are
accepted.
A tweak is a number which is lucky and belong to each segment.
we will be provided k segments and n as max number of move attempts.
we have to maximize tweak .
e.g. k =2  and n = 7
 L and R are :
40 45
47 74

maximum tweaks are: 2

42 47
44 71

tweak : 44 47 number of moves 5

I was asked this question in a coding round ? anyone suggest how to
implement this?

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] coding round question

2011-10-30 Thread Siddhartha Banerjee
could you please explain the question in a bit more detail?
especially the partThere are some particular
numbers which are made using 4 or 7 : any combination of 4 and 7 are
accepted.

from what i understand of the question, there are some intervals given...
we can move the intervals left or right by one unit, any such movement
counts as one move... we have to move the segments in such a way that it
maximizes the maximum number of segments where a number can lie...the
maximum number of moves allowed are given... is that true???

by the way, which company's coding round was it???

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] coding round question

2011-10-30 Thread aniket chatterjee
+1

On Sun, Oct 30, 2011 at 6:53 AM, Siddhartha Banerjee 
thefourrup...@gmail.com wrote:

 could you please explain the question in a bit more detail?
 especially the partThere are some particular
 numbers which are made using 4 or 7 : any combination of 4 and 7 are
 accepted.

 from what i understand of the question, there are some intervals given...
 we can move the intervals left or right by one unit, any such movement
 counts as one move... we have to move the segments in such a way that it
 maximizes the maximum number of segments where a number can lie...the
 maximum number of moves allowed are given... is that true???

 by the way, which company's coding round was it???

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.