Why Nostr? What is Njump?
2024-06-30 11:22:29

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!
Author Public Key
npub1ggv8luc0q568f8wntmqzrhl0uryxnf4xacjlnn07j96h84zqy24qepn0dk