• Skip to primary navigation
  • Skip to content
  • Skip to footer
make it. - twocvx
  • Category
  • Tag
    leejongseok

    leejongseok

    Happy 2024

    • Republic of Korea
    • twocvx1@gmail.com
    • GitHub
    • TOTAL POSTS 64
    • Programming
      • C/C++ (1)
      • Python (4)
      Coding Test
      • Algorithm (6)
      • Coding Test (26)
      Data
      • Data Analysis (3)
      • Tableau (13)
      DataBase & Server
      • SQL (6)
      • DataBase (1)
      etc
      • etc (4)

    [Baekjoon] 30700 - KOREA 문자열 만들기 (Python)

    December 3, 2023

    On this page

    • Baekjoon 30700 KOREA 문자열 만들기



    Baekjoon 30700 KOREA 문자열 만들기

    Greedy basic



    image

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    s = input()
    #KEKRORKAKROEKREORKA
    
    korea = 'KOREA'
    
    cnt = 0
    
    for i in s:
        if i == korea[cnt % 5]:
            cnt += 1
    
    print(cnt)
    

    Tags: baekjoon, codingtest, greedy

    Categories: CodingTest

    Updated: December 3, 2023

    Previous Next

    Leave a comment

    You may also enjoy

    tistory로 이사 했습니다.

    January 21, 2025

    tistory로 이사 했습니다.

    데이터분석 준전문가(ADsP) 후기(?)

    March 15, 2024

    [Baekjoon] 13909 - 창문 닫기 (Python)

    February 8, 2024

    [Baekjoon] 17103 - 골드바흐 파티션 (Python)

    February 7, 2024

    • Follow:
    • Feed
    © 2025 Jongseok Lee. Powered by Jekyll & Minimal Mistakes.