find the longest common suffix among a list of inputs. for efficiency, this function simply reverses the character ordering of each input, and then uses commonPrefix.
inputs
import { assertEquals } from "jsr:@std/assert"assertEquals(commonSuffix([ "file:///C:/Hello/World/This/Is/An/Example/Bla.cs", "file:///C:/Hello/Users/This/Is-An/Example/Bla.cs", "file:///C:/Hello/Users/This/Is/YetAnother-An/Example/Bla.cs", "file:///C:/Hello/Earth/This/Is/Not/An/Example/Bla.cs",]), "An/Example/Bla.cs") Copy
import { assertEquals } from "jsr:@std/assert"assertEquals(commonSuffix([ "file:///C:/Hello/World/This/Is/An/Example/Bla.cs", "file:///C:/Hello/Users/This/Is-An/Example/Bla.cs", "file:///C:/Hello/Users/This/Is/YetAnother-An/Example/Bla.cs", "file:///C:/Hello/Earth/This/Is/Not/An/Example/Bla.cs",]), "An/Example/Bla.cs")
find the longest common suffix among a list of
inputs
. for efficiency, this function simply reverses the character ordering of each input, and then uses commonPrefix.Example