probelm Link : https://school.programmers.co.kr/learn/courses/30/lessons/17680
def solution(cacheSize, cities):
answer = 0
arr =[]
for c in cities:
c= c.lower()
if cacheSize :
if c not in arr:
if len(arr) == cacheSize:
arr.pop(0)
arr.append(c)
answer += 5
else:
arr.remove(c)
arr.append(c)
answer +=1
else:
answer += 5
return answer
LRU란 ?
가장 오래된 페이지를 교체하는 알고리즘