mercredi 27 mai 2020

How to match two ordered sequence of numbers by their interval distances

I am trying to match two sequence of numbers(ordered), with their distance,for example:

A={1,3,5,8,10} B={2,5,7,9}

the expect result is:

A'={3,8,10} with interval distance:{5,2} B'={2,7,9} woth interval distance:{5,2}

I am now using the brute-force way, but looking for an elegent method.

Aucun commentaire:

Enregistrer un commentaire