Post History
JavaScript (Node.js), 146 bytes f=(a,c=n=~(b=d=[],e=x=>x&&(c>191|d>2?b.push(d+192,c):b.push(...d+n?[c,c]:[c]),c=n,d=0)))=>(a.map(b=>c^n?c=(e(d>62|b-c),d++,b):(c=b,d=1))...
Answer
#2: Post edited
- # JavaScript (Node.js), 146 bytes
- <!-- language-all: lang-javascript -->
- f=(a,c=n=~(b=d=[],e=x=>x&&(c>191|d>2?b.push(d+192,c):b.push(...d+n?[c,c]:[c]),c=n,d=0)))=>(a.map(b=>c^n?c=(e(d>62|b-c),d++,b):(c=b,d=1)),e(c-n),b)
[Try it online!][TIO-khrwc9gy]<br>Ungolfed version: [TIO](https://tio.run/##zZTBjoIwFEX3fMVzRRsVi05mQ8pifmGWxgXUVjHYklImToRvd9oizhBnL12Q3HffvRy64JR9ZTXTRWWWUu357SZoISuaXgOAkhtQjaHbXXJX@bfhVDZlOQyYNJQkgVVMydqA5vuGcaCAMNAUXAtAIZALppRcGGlbm0npBvceuDdEVVMfkXPn1ly4ZZx4u@NlzZ82/yz4dhtaxvg/u/PPETYM0Nb15EJp1NPnoATYz8cjbqCUgks/kPsp5AOCLbQyfkglTSEbPiAEv5i26n3TtvmMUk95T/TXhnASBM/9Njafe1znDlCzASp4KtDcNFq660qC7pZs7SgkhMRkTTbkLVzcNfGzmJB@kvNcMMJith5tvOhMgWEqFNPhGEjES88UGKZCMR0OT7KLzlmFMpq6H6oqeVSqA0IfjRBcR0KrMxIjlS3CI7@EGOPIqE@jC3lA/cQWGXZEq@i67lYH3LbbHY5OqpAoBLef3H4A)- [TIO-khrwc9gy]: https://tio.run/##zZTBbsIwEETv/QpOZK0YY6eoEkEOUn@hxyiV7LUdQGBHIVSRmvbX0xDogS8ge5vR7Oid5qC@1BnrfdUsfDC2750ERVF6@QtaGpkX1MpWZu18DpiJtehMlmw1qy7nHZhYrBOKJL1rxpiJ/TZHikWaY0GuRdRITgiRGSh2UtXQmuGn36IECyZ7Szq9QEJNHFNNUkCphwdBCLWAC08Gs9/kL7NZxDkXPOGvfBXRu@ajJzi/OdpqhxwFJg@JJ90UGKZCMR2OfxL31JsCw1QopsMxkhTjSKlhpII/h6Nlx1ACvF@cszVzdTiBe1CKRjvbRsPCsSZ8NPXel3BzhqIGd7Bk38nPsiRdlxeEHcLeQzS75jf9Hw "JavaScript (Node.js) – Try It Online"
- # JavaScript (Node.js), 146 bytes
- <!-- language-all: lang-javascript -->
- f=(a,c=n=~(b=d=[],e=x=>x&&(c>191|d>2?b.push(d+192,c):b.push(...d+n?[c,c]:[c]),c=n,d=0)))=>(a.map(b=>c^n?c=(e(d>62|b-c),d++,b):(c=b,d=1)),e(c-n),b)
- [Try it online!][TIO-khrwc9gy]
- [Ungolfed version](https://tio.run/##zZTBjoIwFEX3fMVzRRsVi05mQ8pifmGWxgXUVjHYklImToRvd9oizhBnL12Q3HffvRy64JR9ZTXTRWWWUu357SZoISuaXgOAkhtQjaHbXXJX@bfhVDZlOQyYNJQkgVVMydqA5vuGcaCAMNAUXAtAIZALppRcGGlbm0npBvceuDdEVVMfkXPn1ly4ZZx4u@NlzZ82/yz4dhtaxvg/u/PPETYM0Nb15EJp1NPnoATYz8cjbqCUgks/kPsp5AOCLbQyfkglTSEbPiAEv5i26n3TtvmMUk95T/TXhnASBM/9Njafe1znDlCzASp4KtDcNFq660qC7pZs7SgkhMRkTTbkLVzcNfGzmJB@kvNcMMJith5tvOhMgWEqFNPhGEjES88UGKZCMR0OT7KLzlmFMpq6H6oqeVSqA0IfjRBcR0KrMxIjlS3CI7@EGOPIqE@jC3lA/cQWGXZEq@i67lYH3LbbHY5OqpAoBLef3H4A)
- [TIO-khrwc9gy]: https://tio.run/##zZTBbsIwEETv/QpOZK0YY6eoEkEOUn@hxyiV7LUdQGBHIVSRmvbX0xDogS8ge5vR7Oid5qC@1BnrfdUsfDC2750ERVF6@QtaGpkX1MpWZu18DpiJtehMlmw1qy7nHZhYrBOKJL1rxpiJ/TZHikWaY0GuRdRITgiRGSh2UtXQmuGn36IECyZ7Szq9QEJNHFNNUkCphwdBCLWAC08Gs9/kL7NZxDkXPOGvfBXRu@ajJzi/OdpqhxwFJg@JJ90UGKZCMR2OfxL31JsCw1QopsMxkhTjSKlhpII/h6Nlx1ACvF@cszVzdTiBe1CKRjvbRsPCsSZ8NPXel3BzhqIGd7Bk38nPsiRdlxeEHcLeQzS75jf9Hw "JavaScript (Node.js) – Try It Online"
#1: Initial revision
# JavaScript (Node.js), 146 bytes <!-- language-all: lang-javascript --> f=(a,c=n=~(b=d=[],e=x=>x&&(c>191|d>2?b.push(d+192,c):b.push(...d+n?[c,c]:[c]),c=n,d=0)))=>(a.map(b=>c^n?c=(e(d>62|b-c),d++,b):(c=b,d=1)),e(c-n),b) [Try it online!][TIO-khrwc9gy]<br> Ungolfed version: [TIO](https://tio.run/##zZTBjoIwFEX3fMVzRRsVi05mQ8pifmGWxgXUVjHYklImToRvd9oizhBnL12Q3HffvRy64JR9ZTXTRWWWUu357SZoISuaXgOAkhtQjaHbXXJX@bfhVDZlOQyYNJQkgVVMydqA5vuGcaCAMNAUXAtAIZALppRcGGlbm0npBvceuDdEVVMfkXPn1ly4ZZx4u@NlzZ82/yz4dhtaxvg/u/PPETYM0Nb15EJp1NPnoATYz8cjbqCUgks/kPsp5AOCLbQyfkglTSEbPiAEv5i26n3TtvmMUk95T/TXhnASBM/9Njafe1znDlCzASp4KtDcNFq660qC7pZs7SgkhMRkTTbkLVzcNfGzmJB@kvNcMMJith5tvOhMgWEqFNPhGEjES88UGKZCMR0OT7KLzlmFMpq6H6oqeVSqA0IfjRBcR0KrMxIjlS3CI7@EGOPIqE@jC3lA/cQWGXZEq@i67lYH3LbbHY5OqpAoBLef3H4A) [TIO-khrwc9gy]: https://tio.run/##zZTBbsIwEETv/QpOZK0YY6eoEkEOUn@hxyiV7LUdQGBHIVSRmvbX0xDogS8ge5vR7Oid5qC@1BnrfdUsfDC2750ERVF6@QtaGpkX1MpWZu18DpiJtehMlmw1qy7nHZhYrBOKJL1rxpiJ/TZHikWaY0GuRdRITgiRGSh2UtXQmuGn36IECyZ7Szq9QEJNHFNNUkCphwdBCLWAC08Gs9/kL7NZxDkXPOGvfBXRu@ajJzi/OdpqhxwFJg@JJ90UGKZCMR2OfxL31JsCw1QopsMxkhTjSKlhpII/h6Nlx1ACvF@cszVzdTiBe1CKRjvbRsPCsSZ8NPXel3BzhqIGd7Bk38nPsiRdlxeEHcLeQzS75jf9Hw "JavaScript (Node.js) – Try It Online"