Skip to main content

New answers tagged

0 votes

Compare two strings, with NaC

JavaScript (Node.js), 86 bytes a=>b=>g(a,0)==g(b)||[g(a,'A')<=g(b,'Z'),g(a,'Z')>=g(b,'A')] g=(a,c)=>a.replace(/1/g,c) Try it online! First check if ...
l4m2's user avatar
  • 24.5k
0 votes

Compare two strings, with NaC

Zsh, 144 bytes Uses _ for NaC and : for insufficient data. ...
GammaFunction's user avatar
2 votes

Compare two strings, with NaC

05AB1E, 16 bytes 1„AZSδ:ø`R‹2βIËM Port of NicolaSap's Python answer (which I've then golfed further using 05AB1E's strengths), so make sure to upvote that answer ...
Kevin Cruijssen's user avatar
6 votes

Compare two strings, with NaC

Python, 92 bytes [🧍‍♂️👫🧍🧑‍🤝‍🧑🧍‍♂️] This is a community effort: Jonathan Allan's and Mukundan314's significant (-37 bytes) improvements on my original idea. ...
Nicola Sap's user avatar
  • 3,685
1 vote

Compare two strings, with NaC

Retina, 89 bytes ¶ ¶$`¶$`¶$'¶ T`@`A`¶.*¶ T`@`Z`¶.* @ \w 1,O` ~L$`^.* %a`$& ¶ 1{5} = .1100 1 .0011 2 ..+ ~ Try it online! Takes input on separate lines and ...
Neil's user avatar
  • 172k
4 votes

Compare two strings, with NaC

Charcoal, 34 bytes ≔⪪θ?ζ≔⪪η?εI∨⁻›⪫ζA⪫εZ‹⪫ζZ⪫εA∧№⁺θη?² Try it online! Link is to verbose version of code. Outputs -1 if the ...
Neil's user avatar
  • 172k
5 votes

Compare two strings, with NaC

Jelly,  19  16 bytes Ḳj¥þØAZŒpM€§QḌ«4 A monadic Link that accepts a pair of lists of characters (from A-Z plus the space ...
Jonathan Allan's user avatar
3 votes

Compare two strings, with NaC

Perl 5 -pl, 69 bytes $_=(($b=<>)=~y/_/Z/r cmp y/_/A/r)-($b=~y/_/A/r cmp y/_/Z/r)||$_ cmp$b Try it online! Strings are ...
Xcali's user avatar
  • 15.3k

Top 50 recent answers are included