자료구조,알고리즘 (51) 썸네일형 리스트형 LeetCode-169 Majority Element 파이썬 풀이 Majority Element - LeetCode Can you solve this real interview question? Majority Element - Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists leetcode.com 문제 int 형 배열 안에서 가장 많이 존재하는 값을 반환하는 문제 입니다. 풀이 nums를 순회하며 각 요소들의 숫자를 세는 방식입니다. a라는 배열에 nums안의 요소들을 중복없이 저장.. LeetCode-80 Remove Duplicates from Sorted Array II 파이썬 풀이 Remove Duplicates from Sorted Array II - LeetCode Can you solve this real interview question? Remove Duplicates from Sorted Array II - Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place [https://en.wikipedia.org/wiki/In-place_algorithm] such that each unique elemen leetcode.com 문제 이전 글에서 풀었던 문제보다 조금 복잡한 문제입니다. 이번엔 한번의 중복까진 허용합니다. 즉 같은 값이 두개까지 존재 할 수 있습니다... LeetCode-27 Remove Element 파이썬 문제풀이 Remove Element - LeetCode Can you solve this real interview question? Remove Element - Given an integer array nums and an integer val, remove all occurrences of val in nums in-place [https://en.wikipedia.org/wiki/In-place_algorithm]. The order of the elements may be changed. Then r leetcode.com 문제 문제를 간략히 요약하자면 int형 배열 nums안에 포함된 모든 val을 제거하는 것 입니다. 파이썬으로 구현하기에 매우 간단한 것처럼 보이지만 in-place 조건이 붙었기 때.. 이전 1 ··· 4 5 6 7 다음