Create a method that accepts a list and an item, and returns true if the item belongs to the list, otherwise false.
Solution:
from typing import List
def include(arr: List[int], item: int) -> bool:
return bool(arr.count(item))
'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글
| 1019. Is it a palindrome? (0) | 2022.10.19 |
|---|---|
| 1018. Find the smallest integer in the array (0) | 2022.10.18 |
| 1016. Multiplication table for number (0) | 2022.10.17 |
| 1015. simple calculator (0) | 2022.10.15 |
| 1014. Find Multiples of a Number (0) | 2022.10.14 |