Generate the Last-to-First Mapping of a String solved by 309

Sept. 22, 2015, 5:42 a.m. by Rosalind Team

The Last-to-First array, denoted LastToFirst(i), answers the following question: given a symbol at position i in LastColumn, what is its position in FirstColumn?

Last-to-First Mapping Problem

Given: A string Transform and an integer i.

Return: The position LastToFirst(i) in FirstColumn in the Burrows-Wheeler matrix if LastColumn = Transform.

Sample Dataset

T$GACCA
3

Sample Output

1

Extra Datasets

Please login to solve this problem.