# Iterate through the array, excluding the last element
for i inrange(len(arr) - 1):
# If the current element is greater than its right - hand neighbor
if arr[i]> arr[i + 1]:
# Add the index of the current element to the indices list
indices.append(i)
# Increment the counter by 1
count +=1
# Print the indices of elements greater than their right - hand neighbors and the corresponding element values
print(f"In the array {arr}, the indices {indices} correspond to elements {[arr[idx] for idx in indices]} which are greater than their right - hand neighbors.")
# Print the number of such elements
print(f"In the array {arr}, the number of such elements (K) is {count}.")
In the array [1.5, 2.3, 1.1, 0.9], the indices [1, 2] correspond to elements [2.3, 1.1] which are greater than their right - hand neighbors.
In the array [1.5, 2.3, 1.1, 0.9], the number of such elements (K) is 2.