Odd length sub - string
else { count . put ( ( int ) str . charAt ( end ) , count . get ( ( int ) str . charAt ( end ) ) == null ? 1 : count . get ( ( int ) str . charAt ( end ) ) + 1 ) ; HashMap < Integer , Integer > c = new HashMap < > ( count ) ; int length = maxPal ( str , start , end + 1 , c ) ; count . put ( ( int ) str . charAt ( end ) , count . get ( ( int ) str . charAt ( end ) ) == null ? - 1 : count . get ( ( int ) str . charAt ( end ) ) - 1 ) ; count . put ( ( int ) str . charAt ( start ) , count . get ( ( int ) str . charAt ( start ) ) == null ? - 1 : count . get ( ( int ) str . charAt ( start ) ) - 1 ) ; return Math . max ( length , maxPal ( str , start + 1 , end , count ) ) ; } } }