If last characters are same Recur for remaining strings by 1. considering last characters of both strings 2. ignoring last character of first string
if ( $ a [ $ m - 1 ] == $ b [ $ n - 1 ] ) return count_1 ( $ a , $ b , $ m - 1 , $ n - 1 ) + count_1 ( $ a , $ b , $ m - 1 , $ n ) ; else