we give array asteroid integer represent asteroid rowfor asteroid absolute value represent size sign represent direction positive meaning right negative meaning leave each asteroid move speedfind state asteroid collision if asteroid meet small explode if size explode two asteroid move direction meet Example 1input asteroid 5105output 510explanation the 10 5 collide result 10 the 5 10 collideExample 2input asteroid 88output Explanation the 8 8 collide explode otherexample 3input asteroid 1025output 10explanation the 2 5 collide result 5 the 10 5 collide result 10 constraints2 asteroidslength 1041000 asteroidsi 1000asteroidsi 0