diff --git a/src/55491e9e50f2fc92f3000074.js b/src/55491e9e50f2fc92f3000074.js new file mode 100644 index 0000000..94dac62 --- /dev/null +++ b/src/55491e9e50f2fc92f3000074.js @@ -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');