Skip to content

Commit 322899c

Browse files
authored
Merge pull request #1189 from ivan1016017/february20
adding changes
2 parents d97f7cf + 70eb07f commit 322899c

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from typing import List, Union, Collection, Mapping, Optional
2+
from abc import ABC, abstractmethod
3+
4+
class Solution:
5+
def removeElement(self, nums: List[int], val: int) -> int:
6+
7+
while val in nums:
8+
nums.remove(val)
9+
10+
return len(nums)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import unittest
2+
from src.my_project.interviews.top_150_questions_round_14\
3+
.remove_element import Solution
4+
5+
6+
class RemoveElementTestCase(unittest.TestCase):
7+
8+
def test_remove_element(self):
9+
solution = Solution()
10+
output = solution.removeElement(nums=[3,2,2,3], val=3)
11+
target = 2
12+
self.assertEqual(output, target)

0 commit comments

Comments
 (0)