일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- 코딩 테스트
- map
- two pointers
- string
- 맛집
- 알고리즘
- 코테
- 해물감성포차
- 발리 음식
- 알탕뚝배기
- algorithum
- 발리인망원
- Array
- 6월 첼린지
- 투포인터
- 사당돈
- invert Binary Tree
- findDulicate
- prefix sum
- LeetCode
- tree
- linked list
- java
- 코딩 테세트
- 망원 밥집
- algorithm
- Find the Duplicate Number
- 른당사피
- Python
- two sum
- Today
- Total
기록하는 공간
문제링크 leetcode.com/explore/challenge/card/march-leetcoding-challenge-2021/588/week-1-march-1st-march-7th/3657/ Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com 답안 1) /** candyType / 2를 하여 먹을 수 있는 사탕 갯수를 구한다. candyType을 Se..
/** * Example: * var ti = TreeNode(5) * var v = ti.`val` * Definition for a binary tree node. * class TreeNode(var `val`: Int) { * var left: TreeNode? = null * var right: TreeNode? = null * } */ class Solution { fun maxDepth(root: TreeNode?): Int { if (root == null) { return 0 } return Math.max(maxDepth(root?.left), maxDepth(root?.right)) + 1 } }
class Solution { fun kthFactor(n: Int, k: Int): Int { val result = (1..n).filter { n % it == 0} return if (result.size >= k) { result.sortedBy({it})[k - 1] } else { -1 } } }
깨끗한 코드 프로그래밍은 기계가 실행할 수 있도록 상세하게 요구사항을 명시하는 작업이며, 이에 해당하는 결과물이 코드다 나쁜 코드 정의 기능 동작만 가능하게 한 코드 일정, 귀찮음, 자기 합리화 등의 이유로 더 이상 손 대지 않은 코드 나쁜 코드로 인한 악영향 개발 속도 저하 나쁜 코드를 읽고 작업하는 시간이 길어진다 생산성 저하 인력이 추가되더라도 기존 시스템을 파악하는 시간이 오래걸린다 르블랑의 법칙 나중은 절대 돌아오지 않는다 라는 법칙 깨끗한 코드 강조하는 특징 세세한 사항까지 꼼꼼하게 처리하는 코드 설계자의 의도를 분명히 한다 각 코드(클래스, 메서드, 함수)는 한가지를 잘한다 주의 깊게 짰다는 느낌을 준다 유명 프로그래머들이 말하는 특징 바아네 스트롭스트룹 논리가 간단하다 코드는 한가지를 잘한..
문제 링크 leetcode.com/problems/consecutive-characters/ Consecutive Characters - 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 코드 class Solution { fun maxPower(s: String): Int { var maxResult = 0 val charArray = s.toCharArray() val charArraySize = s.toCharArray().size for (i in 0 unt..