Walmart Coding Question – Solved

9 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.

Asked in: Walmart

Image of the Question

Question Image

All Testcases Passed βœ”



Passcode Image

Solution


Please login to view the solution


Related Questions

| The supply chain manager at one of Amazon's warehouses is shipping the last con… |
| Determine the highest value after executing n steps on an infinite 2D grid that… |
| Amazon Prime Video is developing a new feature called "Segmentify." This featur… |
| In this new stock prediction game launched on Amazon Games, Player 1 provides P… |
| Amazon operates numerous warehouses, with each warehouse holding inventory[i] u… |
| In Amazon's highly efficient logistics network, minimizing operational overhead… |