r€⁸Œp»\QṚ
온라인으로 사용해보십시오!
방법?
r€⁸Œp»\QṚ - Link: integer, N e.g. 4
€ - for €ach of implicit range of N (i.e. for i in [1,2,3,...N])
⁸ - with the chain's left argument, N on the right:
r - inclusive range (for i<=N this yields [i, i+1, ..., N]
- ...leaving us with a list of lists like the post-fixes of [1,2,3,....,N]
- e.g. [[1,2,3,4],[2,3,4],[3,4],[4]]
Œp - Cartesian product* of these N lists
- e.g. [[1,2,3,4],[1,2,4,4],[1,3,3,4],[1,3,4,4],[1,4,3,4],[1,4,4,4],[2,2,3,4],[2,2,4,4],[2,3,3,4],[2,3,4,4],[2,4,3,4],[2,4,4,4],[3,2,3,4],[3,2,4,4],[3,3,3,4],[3,3,4,4],[3,4,3,4],[3,4,4,4],[4,2,3,4],[4,2,4,4],[4,3,3,4],[4,3,4,4],[4,4,3,4],[4,4,4,4]]
\ - cumulative reduce with:
» - maximum (vectorises)
- e.g. [[1,2,3,4],[1,2,4,4],[1,3,4,4],[1,3,4,4],[1,4,4,4],[1,4,4,4],[2,4,4,4],[2,4,4,4],[2,4,4,4],[2,4,4,4],[2,4,4,4],[2,4,4,4],[3,4,4,4],[3,4,4,4],[3,4,4,4],[3,4,4,4],[3,4,4,4],[3,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4],[4,4,4,4]]
Q - de-duplicate e.g. [[1,2,3,4],[1,2,4,4],[1,3,4,4],[1,4,4,4],[2,4,4,4],[3,4,4,4],[4,4,4,4]]
Ṛ - reverse e.g. [[4,4,4,4],[3,4,4,4],[2,4,4,4],[1,4,4,4],[1,3,4,4],[1,2,4,4],[1,2,3,4]]
* 다른 입력으로 위에서 사용한 데카르트 제품의 진행 상황을보다 쉽게 확인할 수 있습니다.
the Cartesian product of [[0,1,2],[3,4],[5]]
is [[0,3,5],[0,4,5],[1,3,5],[1,4,5],[2,3,5],[2,4,5]]
ith가 항상 1- 인덱싱 됨을 명시 적으로 명시 할 수 있습니다 .