or
Code Golf array-manipulation counting
A-ee
Given a list of positive integers, output how many items are strictly less than the previous item. The first item will never be counted.
### Test cases
|Input|Output|
|:---:|:----:|
|[1 2 5 8 12 21 51]|0|
|[4 2 5 2 1 5 2]|4|
|[4 5 3 6 2 7 1 8]|3|
|[3 3 3 1 1 1]|1|
# [APL (Dyalog Unicode)], 6 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?") [^SBCS^](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")

Anonymous tacit prefix function. The rare case of ASCII-only APL!

apl
+/2>/+

[Try it online!][TIO-k84oab5w]

|Code|Explanation
|-|-
|+|the numbers
|2>/|pairwise greater-than
|+/|sum

[APL (Dyalog Unicode)]: https://www.dyalog.com/
[TIO-k84oab5w]: https://tio.run/##SyzI0U2pTMzJT///X1vfyE5f@3/ao7YJj3r7HnU1P@pd86h3y6H1xo/aJj7qmxoc5AwkQzw8g/@nKRgqGCmYKlgoGBopGBkqmBpypSmYgIWMgFJAEsw3VTBWMAOKmAPFLIAixmBoCIIA "APL (Dyalog Unicode) – Try It Online"
Count inverted items
Of course. My bad.
'less than' looks right to me — 2 is the second item and 1 is the first, isn't it?
@A-ee Ah, you mean *strictly **greater** than*, no?
@A-ee Wait, can you explain how this works? E.g. for the first test case, 1 is strictly less than 2, no? so how can the result be 0?
I've changed it to regular 'Code Golf'
I can't, but current procedure is to flag and comment.
The speed aspect was a misclick... can you change it to Code Golf?
Any particular reason? I like it. It just needs a spec for the speed aspect.
@Adám Because I want to delete it.
@A-ee Why the flag?
@Adám I don't know - how can I delete it?
@A-ee How is this timed?
I just noticed this is speed challenge. Do you intend that rather the code golf? I don't understand how it would work. And it seems pretty trivial in terms of run-time to do this quickly by iterating once through the list.
I made some edits, let me know if they look OK
I think some test cases where adjacent elements are equal would be good
I'd explicitly specify that in the body.
@liek So the first element will never be counted?