Post History
Q/KDB+, 39 bytes {"#",?[4=count x;x 1 1 2 2 3 3;6#1_x]} Testing the function: q)cc:{"#",?[4=count x;x 1 1 2 2 3 3;6#1_x]} q)cc "#ABCDEF" "#ABCDEF" q)cc "#A" "#AAAAAA" q)cc "#AB" "#ABABAB...
Answer
#2: Post edited
- **Q/KDB+**, **39 bytes**
{"#",?[4=count x;x 1 1 2 2 3 3;6#1_x]}
- **Q/KDB+**, **39 bytes**
- {"#",?[4=count x;x 1 1 2 2 3 3;6#1_x]}
- Testing the function:
- q)cc:{"#",?[4=count x;x 1 1 2 2 3 3;6#1_x]}
- q)cc "#ABCDEF"
- "#ABCDEF"
- q)cc "#A"
- "#AAAAAA"
- q)cc "#AB"
- "#ABABAB"
- q)cc "#ABC"
- "#AABBCC"
- q) is the prompt, other lines are the outputs. Instead of = the assignment operator is : in Q.