diff --git "a/leetcode3/\354\265\234\354\233\220\354\244\200/775. Global and Local Inversions.py" "b/leetcode3/\354\265\234\354\233\220\354\244\200/775. Global and Local Inversions.py" new file mode 100644 index 00000000..2c931ad3 --- /dev/null +++ "b/leetcode3/\354\265\234\354\233\220\354\244\200/775. Global and Local Inversions.py" @@ -0,0 +1,7 @@ +class Solution: + def isIdealPermutation(self, nums: list[int]) -> bool: + for i, num in enumerate(nums): + if abs(num - i) > 1: + return False + + return True