25
一个简单的模式
输入: 您选择的输入格式中的两位数字(我们称它们为m和n)和两个字符(我们称其为a和b)。 输出: 对于演练,请假装m=2, n=5, a='a', b='b'。 您的输出将是根据四个输入构建的字符串。让我们result用value 调用字符串""。首先,连击a到result m时间,所以串连a到result 2倍。result现在等于aa。其次,连击b到result m时间,所以串连b到result 2倍。result现在等于aabb。最后,如果结果已经比更长n,请截断result它,使其具有length n。否则,继续交替使用m的长度运行a,并b直到result有长度n。最终result是aabba,它有长度5。 测试用例: Input: m = 2, n = 4, a = A, b = B Output: AABB Input: m = 3, n = 8, a = A, b = B Output: AAABBBAA Input: m = 4, n …
17
code-golf
string
code-golf
arithmetic
code-golf
string
array-manipulation
rubiks-cube
code-golf
math
number
code-golf
tips
bash
code-golf
ascii-art
music
code-golf
arithmetic
code-golf
math
number
arithmetic
integer
code-golf
number
array-manipulation
code-golf
geometry
grid
set-partitions
code-golf
math
number
code-golf
combinatorics
code-golf
regular-expression
code-golf
permutations
code-golf
ascii-art
code-golf
number
array-manipulation
matrix
code-golf
kolmogorov-complexity
compile-time
cops-and-robbers
polyglot
cops-and-robbers
polyglot
code-golf
string
code-golf
string
ascii-art
matrix
animation
code-golf
ascii-art
code-golf
string
balanced-string
code-golf
integer
integer-partitions
expression-building