Difference between revisions of "Array.pack()"

From ZCubes Wiki
Jump to navigation Jump to search
 
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="wikitable" 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