Post History
Python, 220 bytes Works with Python 3.8 or newer. n=" IVXLCDM" x=("".join([n[(d:=ord(c)-32)//8]+n[d-8*(d//8)]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;...
Answer
#11: Post edited
- # [Python], 220 bytes
- Works with Python 3.8 or newer.
- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(d:=ord(c)-32)//8]+n[d-8*(d//8)]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv8huwl2]
- [Python]: https://docs.python.org
- [TIO-lv8huwl2]: https://tio.run/##TY5fT4MwFMXf9ynaW7q1sIFKohPWOINRiGPbi9gEccGxRcxWCJvJ/PSz4Ivn4d5zfsn9U/8cPyvljuvmfFYCUJTIWfAQQ@8kGID9VZWKpSplhSeqpmBrPnKvuOOMM0ulxWhsskIHnm2rBq1RqQb95SsObTx1jPDRmD5BeA3TG7hwyfKOzumCvtCMvtNVf95fYBNb@BILfIsn2MO@IYwJmGCRmMzJjCzIMwmIIBMah5y/DVbS9wcZ571G7PL9R5GjtbfPT@yAyi3SRekHNrvDBu6h/aYjJ/tQ78oj4/zcMvW9b2kKUQJDBHGgJZOo81qzoHWR1h@R8r/tRmTcZSkDyLweQqhuSnVkevEQNW3Tl34B "Python 3.8 (pre-release) – Try It Online"
There are 8 kind of characters, " IXLCDM". 2 characters are 6 bits that can be easily mapped to printable characters (after code point 32). This string is much shorter (half) then the "DD DM IC ..." string itself. Even if I add the extraction it is still somewhat shorter.I just regenerate the " IXLCDM" characters from this string.- So it is the same as the code below just with some decoding from 6-bit-string.
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
- # [Python], 220 bytes
- Works with Python 3.8 or newer.
- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(d:=ord(c)-32)//8]+n[d-8*(d//8)]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv8huwl2]
- [Python]: https://docs.python.org
- [TIO-lv8huwl2]: https://tio.run/##TY5fT4MwFMXf9ynaW7q1sIFKohPWOINRiGPbi9gEccGxRcxWCJvJ/PSz4Ivn4d5zfsn9U/8cPyvljuvmfFYCUJTIWfAQQ@8kGID9VZWKpSplhSeqpmBrPnKvuOOMM0ulxWhsskIHnm2rBq1RqQb95SsObTx1jPDRmD5BeA3TG7hwyfKOzumCvtCMvtNVf95fYBNb@BILfIsn2MO@IYwJmGCRmMzJjCzIMwmIIBMah5y/DVbS9wcZ571G7PL9R5GjtbfPT@yAyi3SRekHNrvDBu6h/aYjJ/tQ78oj4/zcMvW9b2kKUQJDBHGgJZOo81qzoHWR1h@R8r/tRmTcZSkDyLweQqhuSnVkevEQNW3Tl34B "Python 3.8 (pre-release) – Try It Online"
- There are 8 kind of characters, " IVXLCDM". 2 characters are 6 bits that can be easily mapped to printable characters (after code point 32). This string is much shorter (half) then the "DD DM IC ..." string itself. Even if I add the extraction it is still somewhat shorter.
- I just regenerate the " IVXLCDM" characters from this string.
- So it is the same as the code below just with some decoding from 6-bit-string.
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
#10: Post edited
- # [Python], 220 bytes
- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(d:=ord(c)-32)//8]+n[d-8*(d//8)]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv8huwl2]
[Python 3.8 (pre-release)]: https://docs.python.org/3.8/- [TIO-lv8huwl2]: https://tio.run/##TY5fT4MwFMXf9ynaW7q1sIFKohPWOINRiGPbi9gEccGxRcxWCJvJ/PSz4Ivn4d5zfsn9U/8cPyvljuvmfFYCUJTIWfAQQ@8kGID9VZWKpSplhSeqpmBrPnKvuOOMM0ulxWhsskIHnm2rBq1RqQb95SsObTx1jPDRmD5BeA3TG7hwyfKOzumCvtCMvtNVf95fYBNb@BILfIsn2MO@IYwJmGCRmMzJjCzIMwmIIBMah5y/DVbS9wcZ571G7PL9R5GjtbfPT@yAyi3SRekHNrvDBu6h/aYjJ/tQ78oj4/zcMvW9b2kKUQJDBHGgJZOo81qzoHWR1h@R8r/tRmTcZSkDyLweQqhuSnVkevEQNW3Tl34B "Python 3.8 (pre-release) – Try It Online"
- There are 8 kind of characters, " IXLCDM". 2 characters are 6 bits that can be easily mapped to printable characters (after code point 32). This string is much shorter (half) then the "DD DM IC ..." string itself. Even if I add the extraction it is still somewhat shorter.
- I just regenerate the " IXLCDM" characters from this string.
- So it is the same as the code below just with some decoding from 6-bit-string.
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
- # [Python], 220 bytes
- Works with Python 3.8 or newer.
- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(d:=ord(c)-32)//8]+n[d-8*(d//8)]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv8huwl2]
- [Python]: https://docs.python.org
- [TIO-lv8huwl2]: https://tio.run/##TY5fT4MwFMXf9ynaW7q1sIFKohPWOINRiGPbi9gEccGxRcxWCJvJ/PSz4Ivn4d5zfsn9U/8cPyvljuvmfFYCUJTIWfAQQ@8kGID9VZWKpSplhSeqpmBrPnKvuOOMM0ulxWhsskIHnm2rBq1RqQb95SsObTx1jPDRmD5BeA3TG7hwyfKOzumCvtCMvtNVf95fYBNb@BILfIsn2MO@IYwJmGCRmMzJjCzIMwmIIBMah5y/DVbS9wcZ571G7PL9R5GjtbfPT@yAyi3SRekHNrvDBu6h/aYjJ/tQ78oj4/zcMvW9b2kKUQJDBHGgJZOo81qzoHWR1h@R8r/tRmTcZSkDyLweQqhuSnVkevEQNW3Tl34B "Python 3.8 (pre-release) – Try It Online"
- There are 8 kind of characters, " IXLCDM". 2 characters are 6 bits that can be easily mapped to printable characters (after code point 32). This string is much shorter (half) then the "DD DM IC ..." string itself. Even if I add the extraction it is still somewhat shorter.
- I just regenerate the " IXLCDM" characters from this string.
- So it is the same as the code below just with some decoding from 6-bit-string.
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
#9: Post edited
# [Python 3.8 (pre-release)], 220 bytes- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(d:=ord(c)-32)//8]+n[d-8*(d//8)]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv8huwl2]
- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
- [TIO-lv8huwl2]: https://tio.run/##TY5fT4MwFMXf9ynaW7q1sIFKohPWOINRiGPbi9gEccGxRcxWCJvJ/PSz4Ivn4d5zfsn9U/8cPyvljuvmfFYCUJTIWfAQQ@8kGID9VZWKpSplhSeqpmBrPnKvuOOMM0ulxWhsskIHnm2rBq1RqQb95SsObTx1jPDRmD5BeA3TG7hwyfKOzumCvtCMvtNVf95fYBNb@BILfIsn2MO@IYwJmGCRmMzJjCzIMwmIIBMah5y/DVbS9wcZ571G7PL9R5GjtbfPT@yAyi3SRekHNrvDBu6h/aYjJ/tQ78oj4/zcMvW9b2kKUQJDBHGgJZOo81qzoHWR1h@R8r/tRmTcZSkDyLweQqhuSnVkevEQNW3Tl34B "Python 3.8 (pre-release) – Try It Online"
- There are 8 kind of characters, " IXLCDM". 2 characters are 6 bits that can be easily mapped to printable characters (after code point 32). This string is much shorter (half) then the "DD DM IC ..." string itself. Even if I add the extraction it is still somewhat shorter.
- I just regenerate the " IXLCDM" characters from this string.
- So it is the same as the code below just with some decoding from 6-bit-string.
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
- # [Python], 220 bytes
- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(d:=ord(c)-32)//8]+n[d-8*(d//8)]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv8huwl2]
- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
- [TIO-lv8huwl2]: https://tio.run/##TY5fT4MwFMXf9ynaW7q1sIFKohPWOINRiGPbi9gEccGxRcxWCJvJ/PSz4Ivn4d5zfsn9U/8cPyvljuvmfFYCUJTIWfAQQ@8kGID9VZWKpSplhSeqpmBrPnKvuOOMM0ulxWhsskIHnm2rBq1RqQb95SsObTx1jPDRmD5BeA3TG7hwyfKOzumCvtCMvtNVf95fYBNb@BILfIsn2MO@IYwJmGCRmMzJjCzIMwmIIBMah5y/DVbS9wcZ571G7PL9R5GjtbfPT@yAyi3SRekHNrvDBu6h/aYjJ/tQ78oj4/zcMvW9b2kKUQJDBHGgJZOo81qzoHWR1h@R8r/tRmTcZSkDyLweQqhuSnVkevEQNW3Tl34B "Python 3.8 (pre-release) – Try It Online"
- There are 8 kind of characters, " IXLCDM". 2 characters are 6 bits that can be easily mapped to printable characters (after code point 32). This string is much shorter (half) then the "DD DM IC ..." string itself. Even if I add the extraction it is still somewhat shorter.
- I just regenerate the " IXLCDM" characters from this string.
- So it is the same as the code below just with some decoding from 6-bit-string.
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
#8: Post edited
- # [Python 3.8 (pre-release)], 220 bytes
- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(d:=ord(c)-32)//8]+n[d-8*(d//8)]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv8huwl2]
- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
- [TIO-lv8huwl2]: https://tio.run/##TY5fT4MwFMXf9ynaW7q1sIFKohPWOINRiGPbi9gEccGxRcxWCJvJ/PSz4Ivn4d5zfsn9U/8cPyvljuvmfFYCUJTIWfAQQ@8kGID9VZWKpSplhSeqpmBrPnKvuOOMM0ulxWhsskIHnm2rBq1RqQb95SsObTx1jPDRmD5BeA3TG7hwyfKOzumCvtCMvtNVf95fYBNb@BILfIsn2MO@IYwJmGCRmMzJjCzIMwmIIBMah5y/DVbS9wcZ571G7PL9R5GjtbfPT@yAyi3SRekHNrvDBu6h/aYjJ/tQ78oj4/zcMvW9b2kKUQJDBHGgJZOo81qzoHWR1h@R8r/tRmTcZSkDyLweQqhuSnVkevEQNW3Tl34B "Python 3.8 (pre-release) – Try It Online"
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
- # [Python 3.8 (pre-release)], 220 bytes
- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(d:=ord(c)-32)//8]+n[d-8*(d//8)]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv8huwl2]
- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
- [TIO-lv8huwl2]: https://tio.run/##TY5fT4MwFMXf9ynaW7q1sIFKohPWOINRiGPbi9gEccGxRcxWCJvJ/PSz4Ivn4d5zfsn9U/8cPyvljuvmfFYCUJTIWfAQQ@8kGID9VZWKpSplhSeqpmBrPnKvuOOMM0ulxWhsskIHnm2rBq1RqQb95SsObTx1jPDRmD5BeA3TG7hwyfKOzumCvtCMvtNVf95fYBNb@BILfIsn2MO@IYwJmGCRmMzJjCzIMwmIIBMah5y/DVbS9wcZ571G7PL9R5GjtbfPT@yAyi3SRekHNrvDBu6h/aYjJ/tQ78oj4/zcMvW9b2kKUQJDBHGgJZOo81qzoHWR1h@R8r/tRmTcZSkDyLweQqhuSnVkevEQNW3Tl34B "Python 3.8 (pre-release) – Try It Online"
- There are 8 kind of characters, " IXLCDM". 2 characters are 6 bits that can be easily mapped to printable characters (after code point 32). This string is much shorter (half) then the "DD DM IC ..." string itself. Even if I add the extraction it is still somewhat shorter.
- I just regenerate the " IXLCDM" characters from this string.
- So it is the same as the code below just with some decoding from 6-bit-string.
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
#7: Post edited
# [Python 3.8 (pre-release)], 223 bytes- <!-- language-all: lang-python -->
- n=" IVXLCDM"
x="".join([n[(o:=(d:=(x:=ord(c))-32)//8)]+n[d-8*o]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;'])- r=lambda c:max(s if s in c else"A"for s in x.split())
[Try it online!][TIO-lv8fdrlb]- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
[TIO-lv8fdrlb]: https://tio.run/##TY5fT8IwFMXf@RTt7Qotf4ZKojhoxMzoFrfBi3PJnAQZxBlolzKT@elnhy@e5N578ns455Y/1aeSk2mpm0YKQH6cBO5DCJ1aANhfqpAslSlTjmC5mdoRSudsy/locsXH4ynPBjLNR9O@yvZKoy0qZK@7esWejRdjy3u0Fk/gXcPiBi4mZHVHI7qkLzSj73TdjbpL3McDfIkFvsVz7OCZJaw59GFAQhKRgCzJM3GJIHMaepy/9dbJbNbLeEeLw@b4kW/Q1jluanZCxR6ZJU3/7nDawT20z5xJbZ/KQ1ExzpuWye9jS1PwYxgiCF2jJPbP3ihwW@cb/ZEk@W9jyJwOQqjUhayYiRoi3R6T/Qs "Python 3.8 (pre-release) – Try It Online"- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
- # [Python 3.8 (pre-release)], 220 bytes
- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(d:=ord(c)-32)//8]+n[d-8*(d//8)]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv8huwl2]
- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
- [TIO-lv8huwl2]: https://tio.run/##TY5fT4MwFMXf9ynaW7q1sIFKohPWOINRiGPbi9gEccGxRcxWCJvJ/PSz4Ivn4d5zfsn9U/8cPyvljuvmfFYCUJTIWfAQQ@8kGID9VZWKpSplhSeqpmBrPnKvuOOMM0ulxWhsskIHnm2rBq1RqQb95SsObTx1jPDRmD5BeA3TG7hwyfKOzumCvtCMvtNVf95fYBNb@BILfIsn2MO@IYwJmGCRmMzJjCzIMwmIIBMah5y/DVbS9wcZ571G7PL9R5GjtbfPT@yAyi3SRekHNrvDBu6h/aYjJ/tQ78oj4/zcMvW9b2kKUQJDBHGgJZOo81qzoHWR1h@R8r/tRmTcZSkDyLweQqhuSnVkevEQNW3Tl34B "Python 3.8 (pre-release) – Try It Online"
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
#6: Post edited
# [Python](https://python.org), 222 bytes```pythonn=" IVXLCDM"r=lambda c:max(s if s in c else"A"for s in ("".join([n[(o:=(d:=(x:=ord(c))-32)//8)]+n[d-8*o]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;'])).split())```I couldn't make it work in TIO (Python 3.8 pre-release), but works for me with Python 3.9 on my computer.# [Python](https://python.org), 225 bytes- <!-- language-all: lang-python -->
- n=" IVXLCDM"
x=("".join([n[(o:=(d:=(x:=ord(c))-32)//8)]+n[d-8*o]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))- r=lambda c:max(s if s in c else"A"for s in x.split())
[Try it online!][TIO-lv7hbizd]- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
[TIO-lv7hbizd]: https://tio.run/##TY5BT4NAFITv/RW7b9myCy1Vm2iFbsRgFGJpexFJEBssbcTAQmhN8NfXpV6c5L2ZfIfJND/Hz1pOZ017OkkBKIjihfcQwqATDMD6qgvJEpmw2hYsV9fZom5ztuV8PL3ik8mMp6ZM8vHMqNN93aItKqQ@XL9i38LuRPMfNfcJ/Gtwb@BiStZ3dElX9IWm9J1uhsvhChvYxJdY4Fs8xzZ2NKHNwQCThGRJFmRFnolHBJnT0Of8Td/EjqOnnA9aUWbVR56hrV1lHTugYo/Uk2rArjzs4B76NWfSWYemLI6M81PP5HfV0wSCCEYIQk8pjoJzVlp4fQqU/kgc/48RpPYAIdS0hTwyVTVCbW@q@xc "Python 3.8 (pre-release) – Try It Online"- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
- # [Python 3.8 (pre-release)], 223 bytes
- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x="".join([n[(o:=(d:=(x:=ord(c))-32)//8)]+n[d-8*o]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;'])
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv8fdrlb]
- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
- [TIO-lv8fdrlb]: https://tio.run/##TY5fT8IwFMXf@RTt7Qotf4ZKojhoxMzoFrfBi3PJnAQZxBlolzKT@elnhy@e5N578ns455Y/1aeSk2mpm0YKQH6cBO5DCJ1aANhfqpAslSlTjmC5mdoRSudsy/locsXH4ynPBjLNR9O@yvZKoy0qZK@7esWejRdjy3u0Fk/gXcPiBi4mZHVHI7qkLzSj73TdjbpL3McDfIkFvsVz7OCZJaw59GFAQhKRgCzJM3GJIHMaepy/9dbJbNbLeEeLw@b4kW/Q1jluanZCxR6ZJU3/7nDawT20z5xJbZ/KQ1ExzpuWye9jS1PwYxgiCF2jJPbP3ihwW@cb/ZEk@W9jyJwOQqjUhayYiRoi3R6T/Qs "Python 3.8 (pre-release) – Try It Online"
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
#5: Post edited
- # [Python](https://python.org), 225 bytes
- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(o:=(d:=(x:=ord(c))-32)//8)]+n[d-8*o]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv7hbizd]
- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
- [TIO-lv7hbizd]: https://tio.run/##TY5BT4NAFITv/RW7b9myCy1Vm2iFbsRgFGJpexFJEBssbcTAQmhN8NfXpV6c5L2ZfIfJND/Hz1pOZ017OkkBKIjihfcQwqATDMD6qgvJEpmw2hYsV9fZom5ztuV8PL3ik8mMp6ZM8vHMqNN93aItKqQ@XL9i38LuRPMfNfcJ/Gtwb@BiStZ3dElX9IWm9J1uhsvhChvYxJdY4Fs8xzZ2NKHNwQCThGRJFmRFnolHBJnT0Of8Td/EjqOnnA9aUWbVR56hrV1lHTugYo/Uk2rArjzs4B76NWfSWYemLI6M81PP5HfV0wSCCEYIQk8pjoJzVlp4fQqU/kgc/48RpPYAIdS0hTwyVTVCbW@q@xc "Python 3.8 (pre-release) – Try It Online"
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
- # [Python](https://python.org), 222 bytes
- ```python
- n=" IVXLCDM"
- r=lambda c:max(s if s in c else"A"for s in ("".join([n[(o:=(d:=(x:=ord(c))-32)//8)]+n[d-8*o]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;'])).split())
- ```
- I couldn't make it work in TIO (Python 3.8 pre-release), but works for me with Python 3.9 on my computer.
- # [Python](https://python.org), 225 bytes
- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(o:=(d:=(x:=ord(c))-32)//8)]+n[d-8*o]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv7hbizd]
- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
- [TIO-lv7hbizd]: https://tio.run/##TY5BT4NAFITv/RW7b9myCy1Vm2iFbsRgFGJpexFJEBssbcTAQmhN8NfXpV6c5L2ZfIfJND/Hz1pOZ017OkkBKIjihfcQwqATDMD6qgvJEpmw2hYsV9fZom5ztuV8PL3ik8mMp6ZM8vHMqNN93aItKqQ@XL9i38LuRPMfNfcJ/Gtwb@BiStZ3dElX9IWm9J1uhsvhChvYxJdY4Fs8xzZ2NKHNwQCThGRJFmRFnolHBJnT0Of8Td/EjqOnnA9aUWbVR56hrV1lHTugYo/Uk2rArjzs4B76NWfSWYemLI6M81PP5HfV0wSCCEYIQk8pjoJzVlp4fQqU/kgc/48RpPYAIdS0hTwyVTVCbW@q@xc "Python 3.8 (pre-release) – Try It Online"
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
#4: Post edited
# [Python 3.8 (pre-release)](https://python.org), 225 bytes- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(o:=(d:=(x:=ord(c))-32)//8)]+n[d-8*o]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv7hbizd]
- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
- [TIO-lv7hbizd]: https://tio.run/##TY5BT4NAFITv/RW7b9myCy1Vm2iFbsRgFGJpexFJEBssbcTAQmhN8NfXpV6c5L2ZfIfJND/Hz1pOZ017OkkBKIjihfcQwqATDMD6qgvJEpmw2hYsV9fZom5ztuV8PL3ik8mMp6ZM8vHMqNN93aItKqQ@XL9i38LuRPMfNfcJ/Gtwb@BiStZ3dElX9IWm9J1uhsvhChvYxJdY4Fs8xzZ2NKHNwQCThGRJFmRFnolHBJnT0Of8Td/EjqOnnA9aUWbVR56hrV1lHTugYo/Uk2rArjzs4B76NWfSWYemLI6M81PP5HfV0wSCCEYIQk8pjoJzVlp4fQqU/kgc/48RpPYAIdS0hTwyVTVCbW@q@xc "Python 3.8 (pre-release) – Try It Online"
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
- # [Python](https://python.org), 225 bytes
- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(o:=(d:=(x:=ord(c))-32)//8)]+n[d-8*o]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv7hbizd]
- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
- [TIO-lv7hbizd]: https://tio.run/##TY5BT4NAFITv/RW7b9myCy1Vm2iFbsRgFGJpexFJEBssbcTAQmhN8NfXpV6c5L2ZfIfJND/Hz1pOZ017OkkBKIjihfcQwqATDMD6qgvJEpmw2hYsV9fZom5ztuV8PL3ik8mMp6ZM8vHMqNN93aItKqQ@XL9i38LuRPMfNfcJ/Gtwb@BiStZ3dElX9IWm9J1uhsvhChvYxJdY4Fs8xzZ2NKHNwQCThGRJFmRFnolHBJnT0Of8Td/EjqOnnA9aUWbVR56hrV1lHTugYo/Uk2rArjzs4B76NWfSWYemLI6M81PP5HfV0wSCCEYIQk8pjoJzVlp4fQqU/kgc/48RpPYAIdS0hTwyVTVCbW@q@xc "Python 3.8 (pre-release) – Try It Online"
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
#3: Post edited
# [Python](https://python.org), 238 bytes- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
- # [Python 3.8 (pre-release)](https://python.org), 225 bytes
- <!-- language-all: lang-python -->
- n=" IVXLCDM"
- x=("".join([n[(o:=(d:=(x:=ord(c))-32)//8)]+n[d-8*o]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%_&N&O!*!+!1!=!9!<!:!;$=$<"*"+#M#N#L#O#K#C#=#<%MH))\'_X;;']))
- r=lambda c:max(s if s in c else"A"for s in x.split())
- [Try it online!][TIO-lv7hbizd]
- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
- [TIO-lv7hbizd]: https://tio.run/##TY5BT4NAFITv/RW7b9myCy1Vm2iFbsRgFGJpexFJEBssbcTAQmhN8NfXpV6c5L2ZfIfJND/Hz1pOZ017OkkBKIjihfcQwqATDMD6qgvJEpmw2hYsV9fZom5ztuV8PL3ik8mMp6ZM8vHMqNN93aItKqQ@XL9i38LuRPMfNfcJ/Gtwb@BiStZ3dElX9IWm9J1uhsvhChvYxJdY4Fs8xzZ2NKHNwQCThGRJFmRFnolHBJnT0Of8Td/EjqOnnA9aUWbVR56hrV1lHTugYo/Uk2rArjzs4B76NWfSWYemLI6M81PP5HfV0wSCCEYIQk8pjoJzVlp4fQqU/kgc/48RpPYAIdS0hTwyVTVCbW@q@xc "Python 3.8 (pre-release) – Try It Online"
- ## 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
#2: Post edited
# [Python 3](https://python.org), 238 bytes- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
- # [Python](https://python.org), 238 bytes
- If the r= part is not needed then 2 bytes less
- <!-- language-all: lang-python -->
- r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split())
- [Try it online!][TIO-lv78jx4k]
- [Python 3]: https://docs.python.org/3/
- [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"
#1: Initial revision
# [Python 3](https://python.org), 238 bytes If the r= part is not needed then 2 bytes less <!-- language-all: lang-python --> r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CCM CDC CMC CMD CMM DCD DCM IIV IIX IVI IXC IXI IXL IXV IXX LXC LXL VIV VIX XCC XCD XCL XCM XCX XLX XXC XXL CCCC IIII MMMM XXXX'.split()) [Try it online!][TIO-lv78jx4k] [Python 3]: https://docs.python.org/3/ [TIO-lv78jx4k]: https://tio.run/##TY8xa8NADIX3/orHLXEgdOkW6FB0i0C3CkHo4KYJNdiOsV1ofr37Ll0qeCfp490DTff16za@bNv82rfDx2eL83Fof5oF3RV8Rpxx6ZdLekvX2/wgu5yRC1SgGWrQAhNYhhmswAWe4Qbn7PBAZESBSKbYs0BKFfdSkMkzuapTAXWFBsOjdsYHeQSMzLg7fU5fiFCMFqMKRWYUfUGfsBioisIiitg9L1Pfrc1@v9Vjxu@hHnhK6umAVOqPcH3MLJM61YQ/EvF/9PR@fAIwzd24Now6YK6N2b8 "Python 3 – Try It Online"