Skip to main content
edited tags
Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661
Became Hot Network Question
Tweeted twitter.com/StackCodeGolf/status/1477882436289712131
deleted 4 characters in body
Source Link
[[9, 4, 2]] -> [[9, 4, 2]]
[6, [1, 9, 4]] -> [[6], [1, 9, 4]]
[7, [5, 3], 2] -> [[7], [5, 3], [2]]
[1, 2, 3, 4, 5] -> [[1, 2, 3, 4, 5]]
[1, [2, 2], 3, [4, 4], 5] -> [[1], [2, 2], [3], [4, 4], [5]]
[[1], 2, 3, 8, 9, [6], 7] -> [[1], [2, 3, 8, 9], [6], [7]]
[[1], 2, 3, [4], 5, [4], 2] -> [[1], [2, 3], [4], [5], [4], [2]]
[9, 8, 7, 6, [5, 4, 3], 2, 1] -> [[9, 8, 7, 6], [5, 4, 3], [2, 1]]
[[8, 2], 9, 5, 1, [6, 4], [4, 5]] -> [[8, 2], [9, 5, 1], [6, 4], [4, 5]]
[7, [5, 3], 2, [1, 2, 3], 9, 8, 7, 8, 9, [10[3, 11]4], [1], [2]] -> [[7], [5, 3], [2], [1, 2, 3], [9, 8, 7, 8, 9], [10[3, 11]4], [1], [2]]
[[9, 4, 2]] -> [[9, 4, 2]]
[6, [1, 9, 4]] -> [[6], [1, 9, 4]]
[7, [5, 3], 2] -> [[7], [5, 3], [2]]
[1, 2, 3, 4, 5] -> [[1, 2, 3, 4, 5]]
[1, [2, 2], 3, [4, 4], 5] -> [[1], [2, 2], [3], [4, 4], [5]]
[[1], 2, 3, 8, 9, [6], 7] -> [[1], [2, 3, 8, 9], [6], [7]]
[[1], 2, 3, [4], 5, [4], 2] -> [[1], [2, 3], [4], [5], [4], [2]]
[9, 8, 7, 6, [5, 4, 3], 2, 1] -> [[9, 8, 7, 6], [5, 4, 3], [2, 1]]
[[8, 2], 9, 5, 1, [6, 4], [4, 5]] -> [[8, 2], [9, 5, 1], [6, 4], [4, 5]]
[7, [5, 3], 2, [1, 2, 3], 9, 8, 7, 8, 9, [10, 11], [1], [2]] -> [[7], [5, 3], [2], [1, 2, 3], [9, 8, 7, 8, 9], [10, 11], [1], [2]]
[[9, 4, 2]] -> [[9, 4, 2]]
[6, [1, 9, 4]] -> [[6], [1, 9, 4]]
[7, [5, 3], 2] -> [[7], [5, 3], [2]]
[1, 2, 3, 4, 5] -> [[1, 2, 3, 4, 5]]
[1, [2, 2], 3, [4, 4], 5] -> [[1], [2, 2], [3], [4, 4], [5]]
[[1], 2, 3, 8, 9, [6], 7] -> [[1], [2, 3, 8, 9], [6], [7]]
[[1], 2, 3, [4], 5, [4], 2] -> [[1], [2, 3], [4], [5], [4], [2]]
[9, 8, 7, 6, [5, 4, 3], 2, 1] -> [[9, 8, 7, 6], [5, 4, 3], [2, 1]]
[[8, 2], 9, 5, 1, [6, 4], [4, 5]] -> [[8, 2], [9, 5, 1], [6, 4], [4, 5]]
[7, [5, 3], 2, [1, 2, 3], 9, 8, 7, 8, 9, [3, 4], [1], [2]] -> [[7], [5, 3], [2], [1, 2, 3], [9, 8, 7, 8, 9], [3, 4], [1], [2]]
deleted 3 characters in body
Source Link

The BC builtin "collects" consecutiveadjacent digits in the array, and groups them into a list, while leaving the existing lists untouched. Applying this to the above lists, the examples make this clear:

For example, with [[1], 2, 3, 48, 59, [6], 7], we group the 2, 3, 48, 59 together, and the 7 to give [[1], [2, 3, 48, 5]9], [6], [7]]

[[9, 4, 2]] -> [[9, 4, 2]]
[6, [1, 9, 4]] -> [[6], [1, 9, 4]]
[7, [5, 3], 2] -> [[7], [5, 3], [2]]
[1, 2, 3, 4, 5] -> [[1, 2, 3, 4, 5]]
[1, [2, 2], 3, [4, 4], 5] -> [[1], [2, 2], [3], [4, 4], [5]]
[[1], 2, 3, 48, 59, [6], 7] -> [[1], [2, 3, 48, 5]9], [6], [7]]
[[1], 2, 3, [4], 5, [4], 2] -> [[1], [2, 3], [4], [5], [4], [2]]
[9, 8, 7, 6, [5, 4, 3], 2, 1] -> [[9, 8, 7, 6], [5, 4, 3], [2, 1]]
[[8, 2], 9, 5, 1, [6, 4], [4, 5]] -> [[8, 2], [9, 5, 1], [6, 4], [4, 5]]
[7, [5, 3], 2, [1, 2, 3], 9, 8, 7, 8, 9, [10, 11], [1], [2]] -> [[7], [5, 3], [2], [1, 2, 3], [9, 8, 7, 8, 9], [10, 11], [1], [2]]

The BC builtin "collects" consecutive digits in the array, and groups them into a list, while leaving the existing lists untouched. Applying this to the above lists, the examples make this clear:

For example, with [[1], 2, 3, 4, 5, [6], 7], we group the 2, 3, 4, 5 together, and the 7 to give [[1], [2, 3, 4, 5], [6], [7]]

[[9, 4, 2]] -> [[9, 4, 2]]
[6, [1, 9, 4]] -> [[6], [1, 9, 4]]
[7, [5, 3], 2] -> [[7], [5, 3], [2]]
[1, 2, 3, 4, 5] -> [[1, 2, 3, 4, 5]]
[1, [2, 2], 3, [4, 4], 5] -> [[1], [2, 2], [3], [4, 4], [5]]
[[1], 2, 3, 4, 5, [6], 7] -> [[1], [2, 3, 4, 5], [6], [7]]
[[1], 2, 3, [4], 5, [4], 2] -> [[1], [2, 3], [4], [5], [4], [2]]
[9, 8, 7, 6, [5, 4, 3], 2, 1] -> [[9, 8, 7, 6], [5, 4, 3], [2, 1]]
[[8, 2], 9, 5, 1, [6, 4], [4, 5]] -> [[8, 2], [9, 5, 1], [6, 4], [4, 5]]
[7, [5, 3], 2, [1, 2, 3], 9, 8, 7, 8, 9, [10, 11], [1], [2]] -> [[7], [5, 3], [2], [1, 2, 3], [9, 8, 7, 8, 9], [10, 11], [1], [2]]

The BC builtin "collects" adjacent digits in the array, and groups them into a list, while leaving the existing lists untouched. Applying this to the above lists, the examples make this clear:

For example, with [[1], 2, 3, 8, 9, [6], 7], we group the 2, 3, 8, 9 together, and the 7 to give [[1], [2, 3, 8, 9], [6], [7]]

[[9, 4, 2]] -> [[9, 4, 2]]
[6, [1, 9, 4]] -> [[6], [1, 9, 4]]
[7, [5, 3], 2] -> [[7], [5, 3], [2]]
[1, 2, 3, 4, 5] -> [[1, 2, 3, 4, 5]]
[1, [2, 2], 3, [4, 4], 5] -> [[1], [2, 2], [3], [4, 4], [5]]
[[1], 2, 3, 8, 9, [6], 7] -> [[1], [2, 3, 8, 9], [6], [7]]
[[1], 2, 3, [4], 5, [4], 2] -> [[1], [2, 3], [4], [5], [4], [2]]
[9, 8, 7, 6, [5, 4, 3], 2, 1] -> [[9, 8, 7, 6], [5, 4, 3], [2, 1]]
[[8, 2], 9, 5, 1, [6, 4], [4, 5]] -> [[8, 2], [9, 5, 1], [6, 4], [4, 5]]
[7, [5, 3], 2, [1, 2, 3], 9, 8, 7, 8, 9, [10, 11], [1], [2]] -> [[7], [5, 3], [2], [1, 2, 3], [9, 8, 7, 8, 9], [10, 11], [1], [2]]
added 72 characters in body
Source Link
Loading
added 62 characters in body
Source Link
Loading
Source Link
Loading