Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def arrayPreviousLess(items)
- array = Array.new
- x = 0
- while (x < items.length)
- array[x] = -1
- y = x - 1
- while (y >= 0)
- if items[y] < items[x] then
- array[x] = items[y]
- break
- end
- y = y - 1
- end
- x = x + 1
- end
- return array
- end
Advertisement
Add Comment
Please, Sign In to add comment