Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions contains-duplicate/gguussuu.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모든 파일은 맨 마지막 줄을 갱신하셔서 빈줄을 추가해서 올려주시면 감사하겠습니다!
줄갱이 없으면 CI 에서 걸려요 ㅜ.ㅜ

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네넵 수정했습니다 !

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* @param {number[]} nums
* @return {boolean}
*/
var containsDuplicate = function(nums) {
//Set은 중복된 값을 허용하지 않기 때문에, 배열을 Set으로 변환한 후 길이를 비교하여 중복 여부를 확인
const hasDuplicate = new Set(nums).size !== nums.length;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gguussuu 님 코드 보고 힌트를 얻어서 저도 덕분에 쉽게 풀었네요ㅎㅎ 👍

return hasDuplicate;
};
Loading