Replace Consecutive
replAltRep.dyn
8KB
Text
1
a = "";
2
b = "landing";
3
c = [[a,a,b,a],[a,b,b,b,a,b],[b,b,b,b,b]];
4
5
d = List.Sublists(c<1>,(0..1),1);
6
e = List.Contains(d<1><2><3>,b);
7
f = List.AllTrue(e<1><2>);
8
g = List.AllIndicesOf(f<1>,true);
9
i = List.TakeEveryNthItem(g<1>,2,0);
10
j = List.SetDifference(0..List.Count(c<1>)-1,i);
11
k = List.Cycle(a,List.Count(i<1>));
12
l = List.GetItemAtIndex(c<1>,j<1>);
13
m = List.Flatten(List.Transpose([l,k])<1>,-1);
14
n = List.Flatten(List.Transpose([j,i])<1>,-1);
15
o = List.SortByKey(m<1>,n<1>)["sorted list"];
Copied!
Last modified 1yr ago
Copy link