f("c.b.a", ".b.a") -> true
f("d.c.b.a, ".b.a") -> false
f("b.a", ".b.a") -> false
function f(x,y) {
// ???
}
Please Login to reply.
if (x.startsWith("d")) return false;
if (x.endsWith(y)) return true;
const splittedX = x.split(".");
if (splittedX.length > 3) return false;