[Hash Table] Single Number
Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. Follow up: Could you implement a solution with a linear runtime complexity and without using extra memory? 2개가 아닌 1개만 있는 원소의 값을 리턴하라는 문제 Hash Table이 아니더라도, 배열만으로도 O(n)으로 풀어낼수는 있다 해당 예시는 XOR을 이용하여 풀어내었다 그러나 나는 Hash를 써보고자 한다 사실 Hash를 쓰는건 아니고 Hash개념의 객체를 만들어 풀어봤다
2021.01.25