분류 전체보기
-
[LeetCode] 451. Sort Characters By Frequency알고리즘 문제 풀이 2021. 10. 22. 10:46
문제 출처: https://leetcode.com/problems/sort-characters-by-frequency/ Sort Characters By Frequency - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 문자열 s가 주어지면, 문자의 빈도수를 기반으로 내림차순으로 정렬하라. 문자의 빈도수는 문자열 내에 문자가 쓰인 횟수를 말한다. 정렬된 문자열을 반환하라. 만약 가능한 답이 여러 개라면, 그중 임의의 하나를 반환하라. 예제 Input: s..
-
[LeetCode] 380. Insert Delete GetRandom O(1)알고리즘 문제 풀이 2021. 10. 21. 19:21
문제 출처: https://leetcode.com/problems/insert-delete-getrandom-o1/ Insert Delete GetRandom O(1) - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 RandomizedSet 클래스를 구현하라: RandomizedSet(): RandomizedSet 객체를 초기화한다. bool insert(int val): 집합 자료구조에 아이템 val이 존재하지 않을 때 추가한다. 만약 아이템이 존재하지..
-
[LeetCode] 151. Reverse Words in a String알고리즘 문제 풀이 2021. 10. 20. 17:21
문제 출처: https://leetcode.com/problems/reverse-words-in-a-string/ Reverse Words in a String - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 입력 문자열 s가 주어지면, 단어의 순서를 반대로 정렬하라. 단어란, 공백 없는 문자의 시퀀스로 정의한다. s 내의 단어는 최소 한 개의 공백으로 구분되어 있다. 단어들의 순서를 뒤집어 단일 공백으로 연결한 문자열을 반환하라. 주의: 문자열 s는 공..
-
[LeetCode] 993. Cousins in Binary Tree알고리즘 문제 풀이 2021. 10. 18. 10:50
문제 출처: https://leetcode.com/problems/cousins-in-binary-tree/ Cousins in Binary Tree - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 각 노드가 유니크한 값을 갖는 이진트리의 $root$와 두 다른 노드의 값 $x$와 $y$가 주어진다. 두 노드 $x$, $y$가 사촌 관계라면 $true$를 반환하고, 그렇지 않다면 $false$를 반환하라. 두 노드가 부모 노드는 다르지만, 같은 깊이에 위..
-
GAI2 Hackathon 끝장개발대회 _ 프로젝트 기획프로젝트/광인사2기 해커톤 2021. 10. 15. 18:22
이 글은 '2021 광주 인공지능 사관학교'의 프로그램인 해커톤(끝장 개발대회)에서 개발했던 웹 서비스에 대한 회고입니다. 대회 기간: 2021.10.12 ~ 2021.10.13 (무박 2일) 주제: 지역사회 전반에 필요한 실용적인 인공지능 웹 서비스 제작 아이디어 선정 아이디어 선정에 있어 고려했던 점은 다음과 같습니다. 만들어질 웹 서비스 자체만으로 사용자에게 유의미한 결과를 제공할 수 있어야 한다. 큰 규모의 시스템을 가정하여, 해당 시스템의 일부 기능만을 구현하지 않기 위함 완성된 하나의 서비스를 만들기 위함 가능한 사전에 학습된 모델을 이용한 서비스여야 한다. 모델을 처음부터 구성하고 훈련시키기에는 프로젝트 기간이 짧음 또한, 훈련 데이터의 확보의 문제가 있기에 사전에 훈련된 모델을 서비스화 시..
-
[LeetCode] 309. Best Time to Buy and Sell Stock with Cooldown알고리즘 문제 풀이 2021. 10. 15. 15:15
문제 출처: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/ Best Time to Buy and Sell Stock with Cooldown - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 prices[i]에 i번째 날의 주식 가격이 적혀있는 배열 prices가 주어집니다. 얻을 수 있는 최대 이익을 찾고자 합니다. 다음 제약사항에 따라, 원하는 만큼의 거래(즉, ..
-
[LeetCode] 1008. Construct Binary Search Tree from Preorder Traversal알고리즘 문제 풀이 2021. 10. 14. 10:33
문제 출처: https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/ Construct Binary Search Tree from Preorder Traversal - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 BST(이진 탐색 트리)를 전위 순회한 결과 배열이 주어지면, 트리를 만들고 그 루트 노드를 반환하라. 주어진 테스트 케이스에는 항상 가능한 이진 탐색 ..
-
[LeetCode] 79. Word Search알고리즘 문제 풀이 2021. 10. 7. 10:53
문제 출처: https://leetcode.com/problems/word-search/ Word Search - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 $m \times n$의 격자 $board$와 문자열 $word$가 주어지면, 격자 내에 $word$가 존재하는지 여부를 반환하라. 단어는 연속적으로 인접한 칸, 이웃한 수직 또는 수평한 칸의 문자로 구성될 수 있다. 동일한 칸의 문자는 한번 이상 사용될 수 없습니다. 예제 Input: board ..