神棍 List.Accumulate (王者归来)

如何碰见重复退出循环:
312456668974444444
第一个重复的值是6,碰见2个6就退出循环,当然了可以是其他的重复值
结果是这个样子的:
312456
代码如何写呢? 开始你可能会一头雾水,不过不要紧,都有这个经历,看大佬的代码看不懂,大佬姿势太多,而且喜欢标新立异,给初学者更是雪上加霜,我刻意打造最通俗易懂的代码,让初学者,很快上手:
第一种结构:
file

= List.Accumulate(Text.ToList("312456666897"),{{},"",""},(x,y)=>if x{2}="" then {x{0}&{y},"",y} else if x{2}=y then {x{0},y,y} else if x{1}="" then {x{0}&{y},"",y}  else {x{0},y,y })

第二种结构:
file

= List.Accumulate(Text.ToList("312456668974444444"),{{},"",""},(x,y)=>if x{1}="" then if x{2}<>y then {x{0}&{y},"",y} else {x{0},y,y} else x)

第三种结构:
file

= List.Accumulate({1..6,6..9},{{},""},(x,y)=>if y = x{1} then {x{0},"t"} else if x{1}="t" then x else {x{0}&{y},y})

给D佬解释一下

if y = x{1} then {x{0},"t"} else if x{1}="t" then x else {x{0}&{y},y}
file
再写一个有趣的题
提取分隔符后面的字符
file

= List.Accumulate(Text.ToList("123456/789"),"",(x,y)=>if y = "/" then ""   else  x&y)

好了写完了,慢慢理解吧!!