The Optimized implementation of Bubble Sort from GeeksforGeeks failed the below test case:
Code:
# @param {Integer[]} nums
# @return {Integer[]}
def sorted_squares(nums)
nums = nums.map { |n| n*n } # square the numbers
# now lets sort with bubble sort