본문 바로가기

Computer Science

[Leetcode/medium] 12. Integer to Roman 미디움 문제 쉽게 풀어서 지금 약간 기분 좋음 https://leetcode.com/problems/integer-to-roman/ integer를 roman으로 변환하는 문제인데 greedy로 해결함...근데 어제 푼 미디움 문제도 greedy였는데... 알고보면 의외로 그리디 문제가 많은듯? 900, 400, 90, 40, 9, 4 등 특수한 케이스에만 roman 숫자가 다르게 적용되기 때문에 500, 100 등으로 나누기 전에 먼저 해당 숫자로 나눠보고 quotient(몫)이 1보다 크면 사용하는 방식으로 해결! 이제 웬만하게 array나 map 등을 greedy로 풀어내는 건 잘 푸는듯 불연듯 학부생 떄나 열심히 하지 이제와서 이걸 왜 풀고 있나 싶기도 한데 오히려 지금이 더 재밌다..... 이.. 더보기
[Leetcode/medium] 11. Container With Most Water 아마존 인터뷰 시리즈 중에 있어서 풀어봄 https://leetcode.com/problems/container-with-most-water/description/ easy 문제인줄 알았는데 나중에 보니 medium문제네... (그렇다고 쉽게 푼것도 아님) 막상 풀려고 보면 brute force로 푸는게 바로 생각남... 실제로 그렇게 푸는 문제는 거의 없으니 아닐게 분명하고.. 힌트를 살짝 봤다 1번힌트: n^2은 아님 (.......그건 나도 알아....) 어쩔 수 없이 2번 힌트 2번힌트: 포인터 2개를 사용해서 값이 작은 쪽을 이동해라 아 듣는순간 해결방법이 바로 떠오름 좌우에서 그리디하게 현재 바가 더 짧은 것을 중앙쪽으로 이동시키면서 최대 면적을 탐색하면 되는구나... 최대 면적 탐색에서 순.. 더보기
[AI/ML] 자동 데이터 이상탐지(anomaly detection)에 관한 고찰 기존에 이상탐지는 주로 확률 기반의 이상탐지나 비지도학습인 RCF(Random Cut Forest)를 활용한 방법이 많이 사용된다. AWS나 opensearch에서 RCF를 지원한다. 이건 Amazon SageMaker(아마존의 ML 플랫폼)에서 RCF를 활용한 유플러스의 개발 브런치글 https://medium.com/uplusdevu/amazon-sagemaker%EC%9D%98-rcf-random-cut-forest-%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98%EC%9D%84-%ED%99%9C%EC%9A%A9%ED%95%9C-%EC%9D%B4%EC%83%81-%EA%B0%90%EC%A7%80-%EC%8B%9C%EC%8A%A4%ED%85%9C-%EB%A7%8C%EB%93%A4%E.. 더보기
[AI/ML] robust하다 라는 뜻은 무엇일까? 통계나 ML 알고리즘 등을 보다보면 robust라는 표현이 종종 등장한다. 자주 나오는 단어인데 정확히 어떤 개념인지 직관적으로 이해되지 않아 오늘 정리하고자 한다. 나는 RCF(Random Cut Forest) 알고리즘 관련 논문을 보려다가 앞에 robust가 있어서 찾아보게된 경우다. 모르면 일단 chatGPT에게 물어본다. 요약하면 예외상황이나 악조건에서도 잘 동작하는 강건한 알고리즘이라는 뜻 그렇다면 실제로도 그런 뜻이 맞을까? 검색해보니 AGI KR이라는 커뮤니티에서 글을 발견 https://www.facebook.com/groups/TensorFlowKR/posts/1349401505400904/?paipv=0&eav=Afb_f_RbSjXGVyOnMPRo45mhTfACikAO8RstvduEK8.. 더보기
35. Search Insert Position https://leetcode.com/problems/search-insert-position/description/ Search Insert Position - LeetCode Search Insert Position - Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must write an algorithm with O(log n) runtime com leetcode.com sorted array에 주어진 하나의 숫자를 정확한 .. 더보기
[LeetCode] 27. Remove Element https://leetcode.com/problems/remove-element/ Remove Element - LeetCode 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 relative order of the elements may be changed. Since it is impossible to change the leng leetcode.com array에서 특정 값을 삭제하는데 in-place 방식(extra datastructre를 사용하지.. 더보기
[LeeCode] 53. Maximum Subarray 목표없이 풀다보니 의지가 약해지는 것 같아 'data structure'로 묶인 문제를 풀기로 결정. https://leetcode.com/study-plan/data-structure/?progress=x0f8sqb1 Data Structure - Study Plan - LeetCode In computer science, a data structure is a way to store and organize data. During the computer programming process, identifying and using the appropriate data structure is an important task as it can improve the overall efficiency of th.. 더보기
[LeetCode] 217. Contains Duplicate 목표없이 풀다보니 의지가 약해지는 것 같아 'data structure'로 묶인 문제를 풀기로 결정. https://leetcode.com/study-plan/data-structure/?progress=x0f8sqb1 Data Structure - Study Plan - LeetCode In computer science, a data structure is a way to store and organize data. During the computer programming process, identifying and using the appropriate data structure is an important task as it can improve the overall efficiency of th.. 더보기