Replace Recurring
Replace recurring item with count
1
def rep(a:var[])
2
{
3
return = [Imperative]
4
{
5
b = 0;
6
c = [];
7
e = 1;
8
for(d in a)
9
{
10
if(d == "unoccupied")
11
{
12
c[b] = String.PadLeft(e+"",2,"0");
13
b = b+1;
14
e = e + 1;
15
}
16
else
17
{
18
c[b] = d;
19
b = b + 1;
20
}
21
}
22
return c;
23
}
24
};
Copied!
Last modified 1yr ago
Copy link