Suppose I press As only throughout . We will have the number of As as A*(number of keystrokes) .This is the least we can get provided we play stupidly enough .
On Jan 29, 9:16 pm, Saikat Debnath <saikat....@gmail.com> wrote: > @ Sankalp : plz explain this line of yours : No. of As=A*(total number > of keystrokes) , gives us a bound . We > should have a lower bound as this , we can always get this much As > > On Jan 29, 5:32 pm, sankalp srivastava <richi.sankalp1...@gmail.com> > wrote:> We can do it Using a binary search approach (The cost function is > > monotonic over here , so we can use binary search) > > > No. of As=A*(total number of keystrokes) , gives us a bound . We > > should have a lower bound as this , we can always get this much As > > > Take the initial value as high and low as possible > > > say left=1 and right=10^9 > > mid=left+right/2; > > if(can_get(this much As)) > > then , left=mid+1; > > > else if(cannot get this much As) > > then , > > right=mid > > Continue this search until left<right .. This binary search gives the > > maximum value which you can get using the given combinations -- 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.