55491e9e50f2fc92f3000074

This commit is contained in:
2025-05-21 18:20:40 +02:00
parent 4e24a777c1
commit 09c4879a2a

View File

@@ -0,0 +1,13 @@
const ride = (a, b) => {
const alph = 'abcdefghijklmnopqrstuvwxyz';
const map = new Map();
[...alph].map((c, i) => map.set(c.toUpperCase(), i + 1));
const cs = s => {
return [...s].reduce((a, b) => a * map.get(b), 1) % 47;
};
return cs(a) === cs(b) ? 'GO' : 'STAY';
};
ride('COMETQ', 'HVNGAT');