Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .

0 like 0 dislike
1,361 views
in Online Assessments by Expert (44,360 points)

2 Answers

0 like 0 dislike
 
Best answer

images of ques

image
image
image

 

by Expert (44,360 points)
0 like 0 dislike

So to solve this problem,

 

aacabc:

 

create substring of length 2: aa, ac, ca, ab, bc

 

aa = 1 (dont consider )
ac = 2
ab = 1
bc = 1

 

sort the substring and see the count, then create the substring with count sort

 

ac + (ab or bc) => 5 as answe

by Expert (44,360 points)
...