LeetCode 665: Non-decreasing Array
Avoid unnecessary special case handling
You exit early if the size of the array is less than 3, but this is unnecessary: the rest of the code already handles arrays of size 0, 1 and 2 correctly. You might save a cycle if you feed it a small array, but you pay for this check with a cycle or two for every time the function is called with std::size(nums) &gt; 2.
Use std::size_t for indices
You made index a std::int_fast32_t, but this has a different size (likely) and a different signedness than the result of std::size(nums). This means the compiler should have warned you about a comparison between signed and unsigned integers. While things work out here, since you know the size of the input array is constrained, it is best to use std::size_t here to avoid the compiler warning. Performance is likely not going to differ one bit, since index can be kept in a CPU register at all times.
There is no need to use std::to_string() when using &lt;&lt; on a std::ostream
When writing to a std::ostream, operator&lt;&lt; will already cause the argument to be formatted, so there is no need to call std::to_string(). In fact, you can tell the stream to format a bool as text:
int main() {
    std::vector&lt;int&gt; nums = {3, 4, 2, 3};
    std::cout &lt;&lt; std::boolalpha &lt;&lt; Solution().checkPossibility(nums) &lt;&lt; &quot;\n&quot;;
}