You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- \$\begingroup\$ Are the exact numbers in the inputs important, or just that the word and alphabet match? For example, in the last case is it necessary that the input represents "995" as a character in the alphabet, or only that the alphabet has 95 characters and the word uses the correct ones? Or, to put it most directly, is it alright if the alphabet is a list of bytes instead of numbers? \$\endgroup\$Kamil Drakari– Kamil Drakari2022-10-05 17:36:44 +00:00Commented Oct 5, 2022 at 17:36
- 1\$\begingroup\$ @KamilDrakari A list of bytes is just fine. After all, bytes are just small numbers- so long as you don't use that fact to trivialize the problem there is nothing wrong with using them. The key thing is that given a 95 character alphabet your answer should theoretically do the right thing, even if practical constraints like limited ram and the heat death of the universe get in the way. \$\endgroup\$Aiden4– Aiden42022-10-05 17:47:09 +00:00Commented Oct 5, 2022 at 17:47
- 1\$\begingroup\$ It seems that the alphabet is always ordered naturally (i.e. a smaller integer always comes before a larger one) - is that guaranteed? (And if so, why not just use a prefix of the natural numbers rather than a sparse set?) \$\endgroup\$Jonathan Allan– Jonathan Allan2022-10-05 17:56:56 +00:00Commented Oct 5, 2022 at 17:56
- \$\begingroup\$ @JonathanAllan taking in the alphabet as a sorted list or ordered set (like a b-tree set or something) is explicitly allowed. I went with the sparse set primarily because I thought it made a slightly more interesting question. \$\endgroup\$Aiden4– Aiden42022-10-05 18:38:56 +00:00Commented Oct 5, 2022 at 18:38
- 2\$\begingroup\$ @Arnauld you don't have to support those cases. Undefined means any behavior is valid, feel free to do whatever's golfiest. \$\endgroup\$Aiden4– Aiden42022-10-05 23:16:28 +00:00Commented Oct 5, 2022 at 23:16
| Show 1 more comment
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
- MathJax equations
\$\sin^2 \theta\$
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. code-golf), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you