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.