Difference between revisions of "Array.pack()"

From ZCubes Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
  
 
[1,2,3,[3,4,4],[3,4,4],3].pack()
 
[1,2,3,[3,4,4],[3,4,4],3].pack()
 
{| style="" id="TABLE2" class="null" donotcaption="true" |
 
|-
 
| 1
 
 
|-
 
| 2
 
 
|-
 
| 3
 
 
|-
 
| 3
 
| 4
 
 
|-
 
| 3
 
  
  
 +
{| style="" id="TABLE1" class="null wikitable" donotcaption="true" |
 +
|- 
 +
|  1
 +
 +
|- 
 +
|  2
 +
 +
|- 
 +
|  3
 +
 +
|- 
 +
|  3
 +
|  4
 +
 +
|- 
 +
|  3
 +
 +
 
|}
 
|}

Latest revision as of 18:52, 5 February 2020


Array.pack()

Remove consecutive duplicates and compact the array.

Example:

[1,2,3,[3,4,4],[3,4,4],3].pack()


1
2
3
3 4
3