Similar Leetcode 735(https://leetcode.com/problems/asteroid-collision/)
Only difference is instead of returning the array of stable asteroids, you should instead count how many right/positive asteroids are left at the end.
Easy to solve with the stack based solution. Just solve as normal and then count at the end.
Is it possible though to solve in O(1) space without modifying the asteroid array? The two pointer solution is O(1), but uses the input array as pseudo stack.