The phrasing might be a bit ambiguous, as magnitude swing could also be thought of as delta(i-1)-delta(i) instead of just delta(i). Nonetheless fun problem!
Flawed solution; fails (for example) when 0
Officially not correct because it assumes that the first entry of x is 1, which is true for all testcases
Flawed solution; fails when delta(1)<0, or when 0
This is genius lololol
great solution Gwendolyn
Very nice the construct to avoid (for example) meshgrid!!
also the use of 'minus' to avois the use of double(...)-double(...)
Is A the inverse of B?
Add two numbers
07 - Common functions and indexing 5
Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
Extra safe primes
Project Euler: Problem 6, Natural numbers, squares and sums.
Is this a valid Tic Tac Toe State?
Make a random, non-repeating vector.
Poker Series 01: isStraightFlush
2048 tile game
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office