For each i , a [ i ] contain number of operations to update s [ i ] to 'a
' NEW_LINE INDENT for i in range ( n ) : NEW_LINE INDENT distance = ord ( s [ i ] ) - ord ( ' a ' ) ; NEW_LINE if ( distance == 0 ) : NEW_LINE INDENT a [ i ] = 0 ; NEW_LINE DEDENT else : NEW_LINE INDENT a [ i ] = 26 - distance ; NEW_LINE DEDENT DEDENT for i in range ( n ) : NEW_LINE DEDENT