본문 바로가기

ror_coding

검색하기
ror_coding
프로필사진 ro_rdil_31

  • Home (160)
    • Data Analysis (13)
      • Growth Hacking (7)
      • Tableau (6)
    • Coding Test (140)
      • Python (86)
      • SQL (54)
    • Certificate (5)
      • 빅데이터 분석 기사 (0)
      • SQLD (3)
      • ADsP (2)
Guestbook
Notice
Recent Posts
Recent Comments
Link
  • RoR's Github
«   2025/08   »
일 월 화 수 목 금 토
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
Tags
  • 조합
  • counter
  • Growth hacking
  • join
  • Level2
  • Queue
  • mysql
  • hackerrank
  • lambda
  • LeetCode
  • coding test
  • Stack
  • itertools
  • programmers
  • coding
  • level4
  • 코딩
  • 완전탐색
  • sql
  • 코테
  • 코딩테스트
  • AARRR
  • cte
  • tableau
  • 파이썬
  • python
  • 프로그래머스
  • import re
  • lv4
  • time complexity
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록tuple (1)

ror_coding

[Programmers] 튜플 - 64065

import re를 활용해서 숫자만 추출한 후에 Counter로 개수 세기! Question 특정 튜플을 표현하는 집합이 담긴 문자열 s가 매개변수로 주어질 때, s가 표현하는 튜플을 배열에 담아 return 하도록 solution 함수를 완성해주세요. Point Counter를 사용 -> 여러 번 나온 수가 먼저 등장한 숫자 => 따라서 등장 횟수가 큰 숫자부터 저장. Code 1 : 정규표현식, Counter 사용. import refrom collections import Counterdef solution(s): s = Counter(re.findall('\d+', s)) return [int(v) for v, cnt in s.most_common()] Code 2 : mine def ..

Coding Test/Python 2024. 12. 4. 15:52
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바