I wrote an algorithm that returns the last position where an element less than x occurs and I passed two parameters to the array: