분류 전체보기(98)
-
2024 년 연간 회고
2024 년 7월 중순에 처음 회사를 입사하게 되었다. 8-9월 한달반이라는 기간동안, 새로운 프로그램의 전체 개발을 맡게되어,진행하며, 스스로의 미숙함에 대해 많이 배울 수 있었다, 회사에서 추구하는것과, 실제로 내가 개발자로서 생각하는것이 일치 하지 않을 수 있음을 알게되는 경험이였다. 9월부터 10월까지, notification과 관련된 로직을 구현하며, 특정 동작에 반응하는 에러메세지를 띄우고 제어하는것이실상 그렇게 간단하지만은 않다는것을 배울 수 있는 경험이였던것 같다.이때, 컨트롤을 각 스테이지마다, 들고 있음으로, 각각의 스테이지에서 분할하여 제어 하는 환경을 생각하였고 이를 구현하며, 현재 환경에 맞고, 틀리고가 매우 중요함을 알 수 있었던 경험이였다. 11월 부터 현재까지, 새로운 알고리..
2024.12.24 -
Longest Palindrome
IntuitionApproachsave character and add even number and odd - 1 if odd is true ? then + 1짝수개씩 더한다음, 홀수개를 더한적 있다면 리턴 에 + 1 을 더하면 가장 긴 길이가 나오게 된다.ComplexityTime complexity:O(N)Space complexity:O(N)Code#include class Solution {public: int longestPalindrome(string s) { vector v(52); for (auto c: s) { if (c >= 'a' && c
2024.12.14 -
First Bad Version
IntuitionApproachsearch divide and check midsearch until left valid이분탐색을 통해 중앙값이 문제가 있으면 end 를 변경하고문제가 없으면 다시 first 가 문제가 있는지 검사하는것을 반복ComplexityTime complexity:log(N)Space complexity:O(1)CodeC++// The API isBadVersion is defined for you.// bool isBadVersion(int version);class Solution {public: int firstBadVersion(int n) { int first = 1; int end = n; if (isBadVersion(firs..
2024.12.11 -
두개의 스택으로 하나의 큐 만들기
Intuitionusing two stack for make queueApproachqueue first in first out stack first in last outthen push first and pop ? first replace to end and last pop 스택은 처음 들어온것이 마지막에,큐는 처음 들어온것이 처음 나가도록 동작한다.따라서, 빠질때, 처음 스택을 다 뺏을때, 마지막으로 나온 데이터가 queue의 결과와 동일한 값을준다.ComplexityTime complexity: O(1) for push, emptyO(N) for pop, peek,Space complexity:O(N)CodeC++#include class MyQueue { std::stack first;pu..
2024.12.11 -
leet code binary search
Intuition단순하게, while.문을 돌면서 중앙의 값이 현재 찾고자 하는 값이 맞는지를 체크하고 아니라면 계속 반복문을 돌도록 함, 만약, 반복문이 끝나도 찾지못한다면 -1 을 리턴하면 간단하게 해결가능하다Approachchange s and e before finding targetwhen s bigger than e but cannot find then return -1;ComplexityTime complexity:O(logN)Space complexity:O(1)Codefunction search(nums: number[], target: number): number { let s = 0; let e = nums.length - 1; if (nums[s] === target) { ..
2024.11.20 -
leet code invert binary tree
가장 아래까지 넘어간뒤 자식 노드를 바꿔치기를 하다보면 결국 스왑되는 형태를 보여주는간단한 문제입니다./** * Definition for a binary tree node. * class TreeNode { * val: number * left: TreeNode | null * right: TreeNode | null * constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) { * this.val = (val===undefined ? 0 : val) * this.left = (left===undefined ? null : left) * this.righ..
2024.11.16