



"""simple docstring"""







from __future__ import annotations

import sys
from collections import deque
from typing import Generic, TypeVar

lowercase__		:    Optional[int]				   =     TypeVar("""T""")







class 				UpperCamelCase__			(     Generic[T]  ):




      """simple docstring"""




      _SCREAMING_SNAKE_CASE      =					42  # Cache store of keys
      _SCREAMING_SNAKE_CASE      =					42  # References of the keys in cache
      _SCREAMING_SNAKE_CASE      =					10  # Maximum capacity of cache



      def __init__(				self    :				Any   ,      SCREAMING_SNAKE_CASE_    :				List[Any]	):
        lowerCAmelCase_       :    Dict								=			deque()
        lowerCAmelCase_       :    Optional[int]								=			set()
        if not n:
          lowerCAmelCase_       :    Any								=			sys.maxsize
        elif n < 0:
          raise ValueError('n should be an integer greater than 0.'	)
        else:
          lowerCAmelCase_       :    List[str]								=			n



      def 					SCREAMING_SNAKE_CASE__			(				self    :				List[Any]   ,      SCREAMING_SNAKE_CASE_    :				List[str]	):
        if x not in self.key_reference:
          if len(self.dq_store	) == LRUCache._MAX_CAPACITY:
            lowerCAmelCase_       :    Any								=			self.dq_store.pop()
            self.key_reference.remove(lowerCAmelCase__	)
        else:
          self.dq_store.remove(lowerCAmelCase__	)

        self.dq_store.appendleft(lowerCAmelCase__	)
        self.key_reference.add(lowerCAmelCase__	)



      def 					SCREAMING_SNAKE_CASE__			(				self    :				Union[str, Any]	):
        for k in self.dq_store:
          print(lowerCAmelCase__	)





      def __repr__(				self    :				Tuple	):
        return F"LRUCache({self._MAX_CAPACITY}) => {list(self.dq_store	)}"


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     lowercase__		:    List[str]				   =     LRUCache(4)
     lru_cache.refer("""A""")
     lru_cache.refer(2)
     lru_cache.refer(3)
     lru_cache.refer("""A""")
     lru_cache.refer(4)
     lru_cache.refer(5)
     lru_cache.display()

     print(lru_cache)
     assert str(lru_cache) == "LRUCache(4) => [5, 4, 'A', 3]"










"""simple docstring"""







import re

def     UpperCamelCase_   (   lowerCAmelCase__				:    str						)						->       bool:

  """simple docstring"""




  lowerCAmelCase_       :    str								=			re.compile(
      R'^(?:0|94|\+94|0{2}94)' R'7(0|1|2|4|5|6|7|8)' R'(-| |)' R'\d{7}$'						)

  return bool(re.search(lowerCAmelCase__   ,       lowerCAmelCase__						)						)


if __name__ == "__main__":
     lowercase__		:    Optional[int]				   =     """0094702343221"""

     print(is_sri_lankan_phone_number(phone))





