You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
함수형 스타일, 불변 컬렉션, 패턴 매칭, 고차 함수(map/filter/reduce) 같은 언어적 특성을 잘 보여줄 수 있는 문제
문자열 처리 / 컬렉션 변환 문제
Scala의 map, flatMap, groupBy, mkString 등을 활용하기 좋음.
예:
Group Anagrams
→ groupBy(_.sorted)
First Unique Character in a String
→ groupBy, count 사용
슬라이딩 윈도우 / 스트리밍 처리 문제
sliding 메서드가 Python보다 더 깔끔하게 표현됨.
예:
Longest Substring Without Repeating Characters
Sliding Window Maximum
Functional Recursion + DP
lazy val, memoization (Map + recursion) 패턴을 Scala에서 자연스럽게 구현 가능.
예:
Climbing Stairs
House Robber
Tree / Graph Traversal
case class, pattern matching으로 트리 구조 다루기 편리.
예:
Binary Tree Inorder Traversal
Number of Islands
(DFS/BFS)
Stream-like 문제
Scala의 immutable List / LazyList로 infinite stream 비슷한 풀이 가능.
예:
Ugly Number
Ugly Number II
Beta Was this translation helpful? Give feedback.
All reactions