https://leetcode.com/problems/queue-reconstruction-by-height


I think my answer is also correct.



```python
class Solution:
    def reconstructQueue(self, people: List[List[int]]) -> List[List[int]]:
        #2023/01/25 06:43
        result = []
        for item in people.copy():
            current_person_height = item[0]
            people_number_that_has_higher_hight_than_current_person = item[1]
            counting = 0
            last_ok_position = None
            got_move = False
            for index, temp_item in enumerate(result):
                temp_person_height = temp_item[0]
                if temp_person_height >= current_person_height:
                    counting += 1
                if counting <= people_number_that_has_higher_hight_than_current_person:
                    last_ok_position = index
                if counting == people_number_that_has_higher_hight_than_current_person:
                    result.insert(index+1, item)
                    got_move = True
                    break
            if got_move == False:
                if last_ok_position == None:
                    result.insert(len(result), item)
                else:
                    result.insert(last_ok_position+1, item)
        return result
        #2023/01/25 07:31
```

___


input:  [[7,0],[4,4],[7,1],[5,0],[6,1],[5,2]]

my_answer: [[7,0],[6,1],[5,2],[7,1],[4,4],[5,0]]

the_leetcode_anser: [[5,0],[7,0],[5,2],[6,1],[4,4],[7,1]]

