← 2023 questions

2023 / TIKTOK / QUESTION 16

Video engagement

Try the question in your own editor, then check your output below.

THE QUESTION

Sofea has posted a TikTok video showing off her latest outfit. Her audience’s engagement and insights is saved as a string, where L is like, U is unlike, C is comment and S is shares.

"LUCLLSLLLULLLLLCLLLLLLLLULLLLLCLLULLLLLLLULLLLLLULLCLCCCLLLLLLLUULLLLLCLLLLLLLLLCLLLLLSLCLLLLLLCLLLLLLLLLLLCLLC"

Print the number of likes, comments, and shares on her video.

Question by Amanda. Source: Girls In Code SEA — Behind the Screens, 2023, slide 32.

CHECK YOUR ANSWER

Try your answer.

Run your program in your own editor, then paste its output below. This checks the stated output; it does not assess your full program. Practice attempts do not affect competition scores.

Enter final likes, comments, shares in that order. Treat each U as undoing one like.

Reveal worked answer

Likes, comments, shares

[80, 13, 2]

There are 88 L events, 8 U events, 13 C events and 2 S events. Final likes = L − U.