Last2

Given a string, return the amount of times that the two last letters appear as a substring of the string. So "hixxxhi" yields 1 (we won't count the end substring) while "aaaNaa" yields 2 (substrings may overlap).

Este exercício foi convertido para o PLM do excelente sítio de exercícios http://javabat.com/