"Coding is just like talking to a unknown girl. Once you talked to her with guts, the next time you'll never afraid",Really? Yes , try it Now !!!
Everything here is for education and learning purpose only , individual holds rights on outer posts/links etc.
Team Cracking The Code
About Me
▼
Saturday, November 19, 2011
Given a string consisting of a,b and c's, we can perform the following operation: Take any two adjacent distinct characters and replace it with the third character. For example, if 'a' and 'c' are adjacent, they can replaced with 'b'. What is the smallest string which can result by applying this operation repeatedly?
@anon ..answer suggested by ashish is pretty much correct , also small correction pointed out by me , a guy czpete425 while anon given correctness of algorithm , dats pretty good explanation :)
answer :: 1
ReplyDelete@Jaideep ..Can You Explain the algorothm or logic on the basis u answered ?
ReplyDeleteJaldeep's answer is wrong:
ReplyDeletetry sequence:
abbbc
I believe correct answer is first comment on:
http://www.careercup.com/question?id=11534280
@anon ..answer suggested by ashish is pretty much correct , also small correction pointed out by me , a guy czpete425 while anon given correctness of algorithm , dats pretty good explanation :)
ReplyDelete