time : O(n) space : O(1) simple bruteforce
On Tue, Aug 9, 2011 at 6:29 PM, ankit sambyal <[email protected]>wrote: > Given an array of characters, change the array to something as shown in the > following example. > Given : ddaaaabbccae > O/P : 2d4a2b2c1a1e > > Do it in the most efficient manner both in terms of time and space ... > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
