79748331

Date: 2025-08-27 18:17:54
Score: 2.5
Natty:
Report link

Isn't that what you need?

function lexicographical_swaps(arr):
    n = length(arr)
    swaps = 0

    for i in 0..n-2:
        for j in i+1..n-1:
            if arr[i] > arr[j]:
                swaps += 1

    return swaps
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): Isn't that
Posted by: Konstantin Makarov