文章作者:Tyan
博客:noahsnail.com | CSDN | 简书
1. Description
Height Checker2. Solution
- Version 1
class Solution:
def heightChecker(self, heights):
count = 0
result = sorted(heights)
for i in range(len(heights)):
if heights[i] != result[i]:
count += 1
return count
网友评论