본문 바로가기

분류 전체보기268

[TIL] 2022.06.25 6월 25일 TIL 1. 알고리즘 문제풀이 leetcode : 1,11,125 백준보다 리트코드 문제가 더 깔끔하고 좋다고 생각한다. 새로운 알고리즘을 배우면 백준에서 어느정도 감을 잡고 리트코드로 문제를 풀어볼 생각이다. 2. cs javascript로 구현하며 작동원리 공부 - 정렬 : https://mocha-blog.tistory.com/116?category=1103350 [알고리즘 구현] 정렬 sort (Javascript) 정렬에 대해 공부하고 직접 구현을 통해 작동 원리를 이해했다. 1. 선택정렬 2. 삽입정렬 3. 퀵정렬 4. 계수정렬 Javascript let arr = [7, 5, 9, 0, 3, 1, 6, 2, 4, 8, 1]; let len = arr.length; function.. 2022. 6. 25.
[leetCode] 125. Valid Palindrome (Javascript) (5) Valid Palindrome - LeetCode Valid Palindrome - 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 접근 : 투포인터 1. 아스키코드를 통한 필터링 2. 앞 뒤 포인터로 값 비교 javascript let input = require("fs") .readFileSync("input.txt") //"/dev/stdin" .toString() .split("\n") .map((val) => val.trim()); function.. 2022. 6. 25.
[leetCode] 11. Container With Most Water (Javascript) (5) Container With Most Water - LeetCode Container With Most Water - 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 접근 : 투포인터 부르트포스로 풀면 시간초과 발생 투포인터를 활용해 문제풀이 Javascript let input = require("fs") .readFileSync("input.txt") //"/dev/stdin" .toString() .split("\n") .map((val) => val... 2022. 6. 25.
[leetCode] 1. Two Sum (Javascript) (5) Two Sum - LeetCode Two Sum - 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 접근 : 투포인터 Javascript let input = require("fs") .readFileSync("input.txt") //"/dev/stdin" .toString() .split("\n") .map((val) => val.trim()); function solution(input) { //input let nums = input[0].split.. 2022. 6. 25.