Problem 729. Flag largest magnitude swings as they occur
You have a phenomenon that produces strictly positive or negative results.
Marching through this list from beginning to end, mark a value with -1 if it is the greatest magnitude negative yet seen (strictly greater, not equal). Mark it with a one if it has the greatest magnitude in the positive direction (strictly greater, not equal). Just use a 0 if neither of these conditions have been met.
The result for the above example would be:
Solution CommentsShow comments
Problem Recent Solvers661