-
알고리즘 Day-1알고리즘 2023. 6. 16. 19:27
알고리즘을 풀면서 헷갈리는 개념에 대해서 다시 한번 적어 보자!
문자열을 반복하는 방법 : string.repeat(count)
아래 예제를 통해서 반복되는 개념을 다시 한번 상기해보자
https://programmers.co.kr/learn/courses/30/lessons/12969
슬라이싱 : slice()
두 정수 사이의 합 : Math.min() Math.max() Math.abs()
양 끝의 합 * (수의차 + 1) / 2 이렇게 계산하는 방식이 너무 수학적 계산이라서 생각도 못했음 ㄷ..
Number()를 써서 반환하는 값 : 숫자가 아닐 시에는(문자) NaN이 출력
프로그래머스에서는 null로 표시가 되어있어서 NaN이라는 것 찾는데 좀 고생 했음
filter를 통해서 차집합 교집합 이런거 구할 수있다 : 숫filter() 와 !arr.include()
sort() 와 reverse()
오늘 풀었던 것 중에서 가장 충격이였던 개념 reverse() 는 내림차순으로 정렬해 주는 녀석이 아니라 그냥 거꾸로 뒤집는 녀석... 짜식..
'알고리즘' 카테고리의 다른 글
[프로그래머스 level.1] 이중반복문, 중복제거, 정렬 (0) 2023.06.20 [프로그래머스 level.1] 06.19 (0) 2023.06.19 알고리즘 & 자료구조 스터디(10조) 8일차 (0) 2023.05.30 알고리즘 & 자료구조 스터디(10조) 7일차 (0) 2023.05.29 알고리즘 & 자료구조 스터디(10조) 6일차 (0) 2023.05.27