프로그래머스 - 양과 늑대 Cpp
문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/92343 프로그래머스 - 양과 늑대 Cpp 문제 풀이이 문제의 가장 어려운 점은 한번 방문한 노드를 여러번 방문할 수 있다는 것이다. 중복을 허용한 탐색을 진행하면 탐색이 끝나지 않으므로, 최대한 중복 방문을 제거하기 위해 비트마스크 를 이용해
문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/92343 프로그래머스 - 양과 늑대 Cpp 문제 풀이이 문제의 가장 어려운 점은 한번 방문한 노드를 여러번 방문할 수 있다는 것이다. 중복을 허용한 탐색을 진행하면 탐색이 끝나지 않으므로, 최대한 중복 방문을 제거하기 위해 비트마스크 를 이용해
https://programmers.co.kr/learn/courses/30/lessons/92342 프로그래머스 - 키패드누르기 Cpp 프로그래머스 - 키패드누르기 Python 유의 사항 화살을 맞춘 개수를 저장하고 정렬하는데 있어서 주의해야 한다. 정렬에 대한 가중치가 앞자리가 아닌 뒷자리 에 있으므로 값을 저장할 때 뒤집어서 저장한 후 내림 차순
https://programmers.co.kr/learn/courses/30/lessons/92342 프로그래머스 - 키패드누르기 Cpp 프로그래머스 - 키패드누르기 Python 유의 사항 화살을 맞춘 개수를 저장하고 정렬하는데 있어서 주의해야 한다. 정렬에 대한 가중치가 앞자리가 아닌 뒷자리 에 있으므로 값을 저장할 때 뒤집어서 저장한 후 내림 차순
문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/92335 프로그래머스 - K진수에서 소수 구하기 Python def is_prime(value): if value <= 1: return False for i in range(2, int(value**0.5)+1):
문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/92341 프로그래머스 - 주차 요금 계산 import mathlimit = 23*60 + 59def time_to_minute(time): times = list(map(int, time.split(':'))) ret
문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/92334 프로그래머스 - 신고 결과 받기 Cpp 프로그래머스 - 신고 결과 받기 Python def solution(id_list, report, k): answer = [0] * len(id_list) dict = {id:
문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/92334 프로그래머스 - 신고 결과 받기 Cpp 프로그래머스 - 신고 결과 받기 Python #include <bits/stdc++.h>using namespace std;vector<string> split(string l
https://programmers.co.kr/learn/courses/30/lessons/60057 프로그래머스 - 문자열 압축 Cpp 프로그래머스 - 문자열 압축 Python 문제 풀이간단한 구현 문제다. 주어진 문자열을 substr 해서 문자열 비교를 통해 같은 문자열의 개수를 찾아내 압축된 문자열 형태로 만들어준 다음 압축된 문자열의 길이를 반
https://programmers.co.kr/learn/courses/30/lessons/60057 프로그래머스 - 문자열 압축 Cpp 프로그래머스 - 문자열 압축 Python 문제 풀이간단한 구현 문제다. 주어진 문자열을 substr 해서 문자열 비교를 통해 같은 문자열의 개수를 찾아내 압축된 문자열 형태로 만들어준 다음 압축된 문자열의 길이를 반
문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/77484 프로그래머스 - 키패드누르기 Cpp 프로그래머스 - 키패드누르기 Python def solution(numbers, hand): answer = '' left_hands = [1, 4, 7] right_
문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/72410 프로그래머스 - 신규 아이디 추천 (Java) 프로그래머스 - 신규 아이디 추천 (Python) 문제 풀이주어진 조건에 맞춰 하나하나씩 구현하면 되는 문제다. 문자열 관련 정규 표현식을 이용하면 더욱 깔끔하게 문제를 해결 할 수 있다.
문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/77484 프로그래머스 - 로또의 최고 순위와 최저 순위 Cpp 프로그래머스 - 로또의 최고 순위와 최저 순위 Java 프로그래머스 - 로또의 최고 순위와 최저 순위 Python def ranking(cnt): if cnt == 6:
문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/77484 프로그래머스 - 로또의 최고 순위와 최저 순위 Cpp 프로그래머스 - 로또의 최고 순위와 최저 순위 Java 프로그래머스 - 로또의 최고 순위와 최저 순위 Python class Solution { private int f
문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/77484 프로그래머스 - 로또의 최고 순위와 최저 순위 Cpp 프로그래머스 - 로또의 최고 순위와 최저 순위 Java 프로그래머스 - 로또의 최고 순위와 최저 순위 Python #include <bits/stdc++.h>using na
문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/77484 프로그래머스 - 키패드누르기 Cpp 프로그래머스 - 키패드누르기 Python #include <iostream>#include <map>#include <queue>#include <string>