You may have seen puzzles like this:
Find the
0
:
OOOOOOOOOOOOOOOOOOOO0OOOOOOOOOOOOOOOOOO
The challenge is to write a program that finds the index of the different letter given an image.
Input
Input will be an Image
. The image will consist of one line of black text in the Helvetica 24 pt. font on a white background. The text will consist from a selection of two characters: one character that is repeated, and one character that appears only once. For instance:
Output
Output will be an Integer
, the index of the different character. In the example above, the output will be 4
. (Note that indices of a string start at 0
)
Program Specifications
As per usual for code golf, the shortest program wins.
Test Cases
=> 10
=> 11
=> 5
=> 16
=> 10
=> 21
=> 20
=> 13
=> 11
=> 4
=> 7