This code works for most inputs except for when the input is in ascending order.
e.g. input is [1,2,3,4,5], output is [5,1,4,2,3], expected is [5,4,3,2,1]
DescBubbleSort(A)
for i from n downto 1 do
for j from n downto i + 1 do
if A[j] > A[j − 1] then
A[j] swap A[j-1]
return A