You are walking from your house to a pond that is down your street. How many blocks over will you have to walk until you get to the pond?
Evaluate how many blocks you will have to walk if you are given a representation of your street where H represents your house, P represents the pond, and every B represents a block in between the two.
A string of letters representing your house, the pond, and blocks on your street.
An integer value that represents the number of blocks between your house and the pond.
BBHBBBBPBBB
4
There are 4 blocks between your house and the pond on your street.