dev._.note

[TIL] 231026_TIL 본문

TIL (Today I Learned)

[TIL] 231026_TIL

Laena 2023. 10. 26. 21:45
🌈 알고리즘을 풀이할 때 짧고 간결하게 쓰려고 노력중

🌈 새로 알게 된 부분
  ⭐️ enumerated()로 배열의 인덱스 가져오기 
  ⭐️  zip함수를 사용해 두가지이상의 배열을 사용하기

🌈 배움이 필요한 부분
  ⭐️ bool배열을 단축인자로 구별하는 법

 

👏 새로 알게 된 부분

⭐️ enumerated 함수

https://how-mrk.tistory.com/entry/Swift-enumerated-%EB%B0%B0%EC%97%B4%EC%9D%98-%EC%9D%B8%EB%8D%B1%EC%8A%A4-%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0

 

[Swift] enumerated() 배열의 인덱스 가져오기

👏 enumerated() Returns a sequence of pairs (n, x), where n represents a consecutive integer starting at zero and x represents an element of the sequence. array값에 enumerated()함수를 사용하면, (index, value) 튜플형식으로 구현된 리스

how-mrk.tistory.com

 

⭐️ zip 함수

https://how-mrk.tistory.com/entry/Swift-zip

 

[Swift] zip

👏 zip(_:_:) 공식문서 정의 : Creates a sequence of pairs built out of two underlying sequences. 두 개의 기본 시퀀스로 만들어진 시퀀스 쌍을 만듭니다. 알고리즘을 풀다가 두 배열의 값을 더해서 다시 배열로 만

how-mrk.tistory.com

 

👏 코딩테스트 풀이

https://github.com/mirae0312/Programmers_Algorithm/tree/main/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4/1

 

 

'TIL (Today I Learned)' 카테고리의 다른 글

[TIL] 231030_TIL  (1) 2023.10.30
[TIL] 231027_TIL  (0) 2023.10.27
[TIL] 231025_TIL  (0) 2023.10.25
[TIL] 231024_TIL  (0) 2023.10.24
TIL 작성 방법  (0) 2023.10.24