🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Learning and Career with AI: all 10 questions

Quiz: Learning and Career with AI · Question 2 of 10

What does compress("aaabccdddd") print?

What does compress("aaabccdddd") print?

  1. A.a3bc2d4
  2. B.a3b1c2d4
  3. C.abcd
  4. D.a3b1c2d3
Answer & explanation

Correct answer: a3b1c2d4

Each run of identical characters becomes the character plus its count, including b1.

Can you get the rest right without peeking?

Take the timed Quiz: Learning and Career with AI quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →