Hongjoo/ 7월 2주차 / 4문제 #234
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🌱WIL
🚀주간 목표 문제 수: 4개
백준 #11723. 집합: 구현, 비트마스킹/ 실버5
정리한 링크: (바로가기)
🚩플로우 (선택)
배열 S 을 아래와 같이 0 으로 초기화한다 (1≤x≤20 란 원소의 크기 제한 존재함)
|연산을 활용하여s[x]=1로 설정하기&연산을 활용해서s[x] = 0설정하기NOR 연산을 활용해 있으면 0 없으면 1 로 설정하기🚩제출한 코드
💡TIL
프로그래머스 #42746. 가장 큰수: 정렬/ lv2
정리한 링크: (바로가기)
🚩플로우 (선택)
입력 numbers 리스트의 원소를 문자열로 형식 변경하기
해당 원소들을 길이를 맞춰 비교한다
key = lambda x : x*2
→ 이 경우 numbers의 원소들은 0≤num≤1,000 제한이 있기 때문에, 숫자의 자리수를 맞춰서 비교하기 위해 *3을 수행한다
출력 형태 맞추기
answer = "".join(numbers)가 아닌answer = str(int("".join(numbers)))을 사용함
🚩제출한 코드
💡TIL
프로그래머스 #42577. 전화번호 목록 : 구현, 해쉬/ lv2
정리한 링크: (바로가기)
🚩플로우 (선택)
글자수로 정렬하기
key = phone_number 요소 인 해쉬맵 생성하기
value = 1
반복문으로 phone num 탐색하면서 앞의 한 글자씩 hashmap의 key임을 확인함
🚩제출한 코드
💡TIL
프로그래머스 #12953. N개의 최소공배수: 구현/ lv2
정리한 링크: (바로가기)
🚩플로우 (선택)
해당 e 로 배열 arr 가 나누어 떨어지는 지 확인
-> 떨어지면 flag = True , 해당 arr[k] 은 e의 몫(arr[k] = arr[k] /e) 으로 구성함
해당 e 값이 배열 arr 의 값 중 하나 이상의 구성 요소일때 , 최소공배수 구성워소 elements 배열에 추가
해당 값이 구성 원소 아닐 경우 -> 다음 e 로 다시 도전하기
🚩제출한 코드