Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

##XPath 3.0 (and XQuery 3.0), 84 bytes

XPath 3.0 (and XQuery 3.0), 84 bytes

codepoints-to-string((0 to 25)!(subsequence(((1 to 26)!(65 to 90)),.*.+1,2*.+1),10))

Explanation:

(1 to 26)!(65 to 90) is the alphabet 26 times

(0 to 25)!(subsequence(XX, start, len),10) takes 26 subsequences of this, each followed by newline

subsequence(X, .*.+1, 2*.+1) takes successive subsequences with start position and length: (1, 1), (2, 3), (5, 5), (10, 9) etc.

codepoints-to-string() turns Unicode codepoints into characters

##XPath 3.0 (and XQuery 3.0), 84 bytes

codepoints-to-string((0 to 25)!(subsequence(((1 to 26)!(65 to 90)),.*.+1,2*.+1),10))

Explanation:

(1 to 26)!(65 to 90) is the alphabet 26 times

(0 to 25)!(subsequence(XX, start, len),10) takes 26 subsequences of this, each followed by newline

subsequence(X, .*.+1, 2*.+1) takes successive subsequences with start position and length: (1, 1), (2, 3), (5, 5), (10, 9) etc.

codepoints-to-string() turns Unicode codepoints into characters

XPath 3.0 (and XQuery 3.0), 84 bytes

codepoints-to-string((0 to 25)!(subsequence(((1 to 26)!(65 to 90)),.*.+1,2*.+1),10))

Explanation:

(1 to 26)!(65 to 90) is the alphabet 26 times

(0 to 25)!(subsequence(XX, start, len),10) takes 26 subsequences of this, each followed by newline

subsequence(X, .*.+1, 2*.+1) takes successive subsequences with start position and length: (1, 1), (2, 3), (5, 5), (10, 9) etc.

codepoints-to-string() turns Unicode codepoints into characters

Formatting
Source Link

XPath##XPath 3.0 (and XQuery 3.0), 9484 bytes

codepoints-to-string((10 to 2625)!(65 to 90)!subsequence(.,let$p:=position()return 10[$p=(1 to 26)!(65 to 90)),.*.+1,2*.+1)],10))

Explanation:

(1 to 26)!(65 to 90) is the alphabet 26 times

(0 to 25)!(subsequence(XX, start, len),10) takes 26 subsequences of this, each followed by newline

subsequence(X, .*.+1, 2*.+1) takes successive subsequences with start position and length: (1, 1), (2, 3), (5, 5), (10, 9) etc.

codepoints-to-string() turns Unicode codepoints into characters

XPath 3.0, 94 bytes

codepoints-to-string((1 to 26)!(65 to 90)!(.,let$p:=position()return 10[$p=(1 to 26)!(.*.)]))

##XPath 3.0 (and XQuery 3.0), 84 bytes

codepoints-to-string((0 to 25)!(subsequence(((1 to 26)!(65 to 90)),.*.+1,2*.+1),10))

Explanation:

(1 to 26)!(65 to 90) is the alphabet 26 times

(0 to 25)!(subsequence(XX, start, len),10) takes 26 subsequences of this, each followed by newline

subsequence(X, .*.+1, 2*.+1) takes successive subsequences with start position and length: (1, 1), (2, 3), (5, 5), (10, 9) etc.

codepoints-to-string() turns Unicode codepoints into characters

Slight improvement of solution
Source Link

XPath 3.0, 9594 bytes

codepoints-to-string((1 to 26)!(65 to 90)!(.,if (positionlet$p:=position()=return 10[$p=(1 to 3026)!(.*.)) then 10 else ()]))

XPath 3.0, 95 bytes

codepoints-to-string((1 to 26)!(65 to 90)!(.,if (position()=(1 to 30)!(.*.)) then 10 else ()))

XPath 3.0, 94 bytes

codepoints-to-string((1 to 26)!(65 to 90)!(.,let$p:=position()return 10[$p=(1 to 26)!(.*.)]))
Source Link
Loading

AltStyle によって変換されたページ (->オリジナル) /