Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
685 views
in Online Assessments by Expert (46,090 points) | 685 views

2 Answers

0 like 0 dislike
Best answer

images of ques

image
image
image

 

by Expert (46,090 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 (46,090 points)