994. Rotting Oranges

각 셀이 세 가지 값 중 하나를 가질 수 있는 m x n 그리드가 제공되고
썩은 오렌지에 4방향으로 인접한 신선한 오렌지는 1분마다 썩게 될때,
셀에 신선한 오렌지가 없을 때까지 경과해야 하는 최소 시간(분)을 반환

Continue reading

211. Design Add and Search Words Data Structure

새 단어 추가를 지원하고 문자열이 이전에 추가된 문자열과 일치하는지 확인하는 데이터 구조를 설계

  • void addWord(word) 데이터 구조에 단어를 추가하고 나중에 일치시킬 수 있습니다.
  • bool search(word) 데이터 구조에 단어와 일치하는 문자열이 있으면 true를 반환하고 그렇지 않으면 false를 반환

Continue reading

146. LRU Cache

LRU(최소 사용) 캐시의 제약 조건을 따르는 데이터 구조를 설계

  • int get(int key) Return the value of the key if the key exists, otherwise return -1.
  • void put(int key, int value) Update the value of the key if the key exists. Otherwise, add the key-value pair to the cache. If the number of keys exceeds the capacity from this operation, evict the least recently used key.
  • The functions get and put must each run in O(1) average time complexity.

Continue reading

2. Add Two Numbers

두 개의 음수가 아닌 정수를 나타내는 두 개의 비어 있지 않은 연결 목록이 제공됩니다. 숫자는 역순으로 저장되며 각 노드에는 단일 숫자가 포함됩니다.
두 숫자를 더하고 합계를 연결된 목록으로 반환

Continue reading

Pagination


© 2017. by yeopoong.github.io

Powered by yeopoong