Advertisement
malixds_

Untitled

Jun 16th, 2023
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. class Solution:
  2. def removeElement(self, nums: List[int], val: int) -> int:
  3. nums = sorted(nums)
  4. the_first_el = nums.index(val)
  5. nums_of_el = nums.count(val)
  6. del nums[the_first_el:nums_of_el]
  7. finish_length = len(nums)
  8. return finish_length, nums
  9.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement