Message Coder

A message encoding of a given non-empty string ss is a dictionary cscs which contains, for each unique symbol in ss, an ordered list of the positions where that symbol occurs within ss.

Implement the function @coder(s)@ such that, given the message ss, it returns a dictionary where the keys are the unique symbols in ss, and the values are ordered lists containing the positions at which each symbol appears in ss.

Sample session

Problem information

Author: Professors Informàtica EEBE

Generation: 2026-01-25T13:39:47.610Z

© Jutge.org, 2006–2026.
https://jutge.org