<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> class Solution : <EOL> def productExcludeItself ( self , A ) : <EOL> """<STR_LIT>""" <EOL> n = len ( A ) <EOL> if n == <NUM_LIT:1> : <EOL> return [ ] <EOL> dp = [ [ <NUM_LIT:1> , <NUM_LIT:1> ] for _ in xrange ( n ) ] <EOL> for i in xrange ( <NUM_LIT:1> , n ) : <EOL> dp [ i ] [ <NUM_LIT:0> ] = A [ i - <NUM_LIT:1> ] * dp [ i - <NUM_LIT:1> ] [ <NUM_LIT:0> ] <EOL> dp [ n - i - <NUM_LIT:1> ] [ <NUM_LIT:1> ] = A [ n - i ] * dp [ n - i ] [ <NUM_LIT:1> ] <EOL> B = [ dp [ i ] [ <NUM_LIT:0> ] * dp [ i ] [ <NUM_LIT:1> ] for i in xrange ( n ) ] <EOL> return B <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> assert Solution ( ) . productExcludeItself ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] ) == [ <NUM_LIT:6> , <NUM_LIT:3> , <NUM_LIT:2> ] </s>
