Skip to content

Conversation

@jungmyunggi
Copy link
Collaborator

문제

Type Info
Time Complexity O(n)
Space Complexity O(n)
Algorithm 정규표현식
Data Structure Set

Constraints

  • 1 <= word.length <= 1000
  • word consists of digits and lowercase English letters.

Edge Case

x

풀이

 const regex = 전체 문자열에서 정수로 이루어진 서브스트링을 찾는 정규표현식
    const arr = word.match(regex)
    if(arr의 길이가 0이면) return 0
    const set = new Set(arr배열 안에 문자열을 정수로 바꾸는 로직)
    return [...set].length

어려웠던 점

  • 정수가 커지면 무한대 값이 나와서 bigInt로 처리했다.

알게된 점

  • 정규표현식 함수를 잘 모르고 있었는데 이번기회에 공부를 하게 되었다.

@jungmyunggi jungmyunggi self-assigned this Jan 2, 2025
@github-actions github-actions bot enabled auto-merge (squash) January 10, 2025 01:26
@github-actions github-actions bot merged commit bb73179 into main Jan 10, 2025
2 checks passed
@BangDori BangDori deleted the jungmyunggi/number-of-different-integers-in-a-string branch January 10, 2025 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants