Problem #4 : First missing positive integer

2020. 8. 15. 18:47PS/도전

All problems are from https://www.dailycodingproblem.com/

 

Solution Codes : https://github.com/Kusin/DailyCoding

 

Kusin/DailyCoding

DailyCodingProblem. Contribute to Kusin/DailyCoding development by creating an account on GitHub.

github.com

Daily coding Problem #4

 

After Solving this Problem, I searched this problem in google. Saw various solutions, found out my solution is unique. 

 

Many solutions used sort. Which makes their code O(n log n). However, my solution works in O(n), and constant space. Check it out.

This is the basic idea. I know that the explain is insufficient. 

Look carefully for the Algorithm

 

mp

 

Implementation

 

728x90

'PS > 도전' 카테고리의 다른 글

Problem #6 XOR Linked List  (0) 2020.08.15
Problem #5 Implementing Pair in Python  (0) 2020.08.15
#3 Parse & ReverseParse a Binary Tree  (0) 2020.08.15
#1 2SUM #2 No Division Multiplying  (0) 2020.08.07
KOI 2019 2차 대회 2번 '괄호' 풀이  (0) 2020.07.11