I need to write code which should find distance of chars. I think i would better explain in example.
I have String Builder like this:
BANSANA
I should take first letter B and find distance to other B letter. However in BANANA there isn’t other B so i write in in S (for example Array List) 1.
So my list now look like this:
S={“1”}
Then i need to take other letter and find it’s distance, so i take A and distance to other A is 2.
My S look like this:
S={“1″,”2”}
So algorithm is repeated till the end.
Maybe someone had done this task and could help me.
Thanks.
Hava a look at this fragment: