🎁 Exclusive Offer! Join our
Telegram Channel
to get **special discounts** and updates! 🚀
Question 25 - 100% Working Solution | Buy Now
Description
4 Live
Counting Repeated Game Scores
During a school sports day event, students record their scores, However, some students accidentally recorded the same score multiple times. Your task is to help the event organizer identify all scores that are repeated and determine the indices where each duplicate occurs.
You are given an integer N, representing the number of students, followed by a list of their scores. For each score that is repeated, output the score, followed by the letter 'T, and then the indices where the score appears. If no duplicates are found, return -1.
Input Format
The first line contains an integer N - the number of students.
The next N lines each contain an integer, representing a score recorded by a student.
| Output Format
For each score that appears more than once, print the score, followed by the letter'l', and then the indices where the score appears, separated by spaces. If no scores are repeated, output -1.