python code (4) 썸네일형 리스트형 문자열 문제 www.acmicpc.net/problem/1157 1157번: 단어 공부 알파벳 대소문자로 된 단어가 주어지면, 이 단어에서 가장 많이 사용된 알파벳이 무엇인지 알아내는 프로그램을 작성하시오. 단, 대문자와 소문자를 구분하지 않는다. www.acmicpc.net S = input().lower() L = [] for i in range(97, 97+26): L.append(S.count(chr(i)))#a갯수, b갯수, c갯수..., z갯수 A = max(L) #각 알파벳 갯수중에 최댓값 if L.count(A) >= 2: #해당 최댓값이 중복인 경우 print("?") else: print(chr(L.index(A) + 97).upper()) www.acmicpc.net/problem/2908 290.. 너비우선탐색문제 www.codingame.com/ide/puzzle/skynet-revolution-episode-1 Coding Games and Programming Challenges to Code Better CodinGame is a challenge-based training platform for programmers where you can play with the hottest programming topics. Solve games, code AI bots, learn from your peers, have fun. www.codingame.com 주어진 그래프에서 Agent가 출구로 나가지 못하도록 노드 사이의 간선을 끊는 것이 이 게임의 목적이다. 즉, Agent에서 출구까지의 경로를 찾고 마지막 .. The gift(그리디 알고리즘) www.codingame.com/training/medium/the-gift Practice Greedy algorithms with the exercise "The Gift" Want to practice coding? Try to solve this puzzle "The Gift" (25+ languages supported). www.codingame.com 문제: 선물의 가격과 n인 의 소지금을 입력하면 가장 공평하게 지불할 수 있는 방법 찾기 경우의 수를 살펴보자 1)선물이 300원이고 3인 각자 120원씩 있다면 -> 모두 100원씩 지불한다 2)선물이 300원이고 3인이 각자 50원, 200원, 200원이 있다면 -> 50원, 125원, 125원씩 지불한다 3)선물이 300원이고 3인이 각자.. Chuck Norris 문제풀이 https://www.codingame.com/training/easy/chuck-norris Practice Strings and Encoding with the exercise "Chuck Norris" Want to practice Strings and encoding? Try to solve the coding challenge "Chuck Norris". www.codingame.com 위 문제는 크게 2가지로 파트로 나눌 수 있다. 1.이진수변환 2.chuck norris 변환 이다. 이 부분들을 함수로 놓고 코딩을 하면 된다. 1. 이진수 변환 이진수를 변환할 때 어떤 방법을 쓸까? 학교에서는 10진수가 있으면 이를 2로 나누어 가면서 나머지를 역순으로 쓰면 된다고 배웠다. 이를 코드로 써보.. 이전 1 다음