chainsawriot on Nostr: Question: What is the best way to implement this? (Or what's the name of this ...
Question: What is the best way to implement this? (Or what's the name of this problem?)
Given a sequence A and sequence B, mark up the matching part between sequence A and B.
e.g.
A: [1,1,4,1,5]
B: [1,4 ] output: [0,1,1,0,0]
B: [1,3] output: [1,0,0,0,0]
B: [4,1] output: [0,0,1,1,0]
B: [1] output: [1,0,0,0,0]
B: [1,1] output: [1,1,0,0,0]
B: [1,4,5] output: [0,1,1,0,1]
B: [2] output: [0,0,0,0,0]
Thank you very much!
Published at
2024-06-30 11:22:29Event JSON
{
"id": "9952bcf4eeade0ba7bf7e8688b169f4642d61c71497046d9377ff2781d868404",
"pubkey": "42187ff30f0534749dd35ec021dfefe0c869a6a6ee25f9cdfe917573d44022aa",
"created_at": 1719746549,
"kind": 1,
"tags": [
[
"proxy",
"https://emacs.ch/users/chainsawriot/statuses/112705309847620142",
"activitypub"
]
],
"content": "Question: What is the best way to implement this? (Or what's the name of this problem?)\n\nGiven a sequence A and sequence B, mark up the matching part between sequence A and B.\n\ne.g.\n\nA: [1,1,4,1,5]\n\nB: [1,4 ] output: [0,1,1,0,0]\nB: [1,3] output: [1,0,0,0,0]\nB: [4,1] output: [0,0,1,1,0]\nB: [1] output: [1,0,0,0,0]\nB: [1,1] output: [1,1,0,0,0]\nB: [1,4,5] output: [0,1,1,0,1]\nB: [2] output: [0,0,0,0,0]\n\nThank you very much!",
"sig": "c60f5ca7e2e1c7aa7cfc00afe174db8e500f06e9522a6a7cc6b47a4ff17637d2f690baac06a211ccb44ba3adff7a7aeb467c3dc13c3630624c85e7ad8624efac"
}