如何在Javascript中将项目数组向上移动4个位置?
我有以下字符串数组:
var array1 = ["t0","t1","t2","t3","t4","t5"];
Run Code Online (Sandbox Code Playgroud)
我需要一个函数转换"array1"导致:
// Note how "t0" moves to the fourth position for example
var array2 = ["t3","t4","t5","t0","t1","t2"];
Run Code Online (Sandbox Code Playgroud)
提前致谢.
在Python中我希望看到一个数字的所有可能组合,但限制为0和1 ...
因此,例如某些循环的结果将是:
0000
0001
0011
0111
1111
1000
and so on.
Run Code Online (Sandbox Code Playgroud)
什么python算法最适合这个?