[Python] 파이썬/Leetcode_14Days plan for DataStructure

[Leetcode] 1. Two Sum {Day 2 Array} (In Python)

두부군_ 2021. 11. 26. 17:58

코드들은 https://github.com/Eastar-DS/Python/tree/main/14%20Days%20Study%20Plan%20about%20Data_Structure에도 있습니다

 

예전에 풀었던문제지만 좀더 효율적이게 푼거같다.

 

기본적이지만 비효율적인 for문 두번돌리기.

 

 

 

딕셔너리를 만들어서 value : index로 저장해두고 target - num을 빠르게 찾아내기.