Determine if a string is collapsible: Difference between revisions

Content deleted Content added
Line 576:
<lang fsharp>
// Collapse a String. Nigel Galloway: June 9th., 2020
//As per the task description a function which 'determines if a character string is collapsible' by testing if any consecutive characters are thesamethe same.
let isCollapsible n=n|>Seq.pairwise|>Seq.tryFind(fun(n,g)->n=g)
//As per the task description a function which 'if the string is collapsable, collapses the string (by removing immediately repeated characters).