Revision 986c729e-bb38-42db-aec6-9638d3470b56 - Code Golf Stack Exchange
The [printable ASCII characters][1] (hex codes 20 to 7E) in order are:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
This string clearly contains all the printable ASCII characters at least once in increasing order when read from left to to right, but not in decreasing order.
The string
REVERSED:~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! NORMAL: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
contains all the printable ASCII characters at least once both in increasing *and* decreasing order. In other words, when the characters are valued with their numeric code, the [longest increasing and longest decreasing subsequences][2] have length 95 (the number of printable ASCII characters).
#Challenge
Choose a *contiguous* subset of N printable ASCII characters, such as `LMNOP` (N = 5). Write a program using only those N characters whose output contains all 95 ASCII characters in increasing *and* decreasing order like the example above.
The winner is the submission with the lowest N. In case of ties the shortest code in bytes wins.
#Notes
- A contiguous subset means a set of the printable ASCIIs that all appear in an unbroken line, such as `LMNOP` or `89:;<=>`.
- Your contiguous subset may "loop around" from `~` to space, but this incurs a +3 penalty on N. So `{|}~` has N = 4, but `{|}~ !` has N = 5 + 3 = 8.
- Your program may only contain the N printable ASCII characters from the contiguous subset you've selected. They do not all have to appear and may appear multiple times in any order.
- Your output may only contain printable ASCII characters and must be less than 10000 characters long.
- Your output's longest increasing and decreasing subsequences must both have length 95 (as explained above).
- Output to stdout. There is no input.
- N is a positive integer less than 96.
[1]: http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
[2]: http://en.wikipedia.org/wiki/Longest_increasing_subsequence