본문 바로가기

전체 글

(206)
[c++] 더 맵게 (프로그래머스 - heap/ priority queue) https://programmers.co.kr/learn/courses/30/lessons/42626 코딩테스트 연습 - 더 맵게 매운 것을 좋아하는 Leo는 모든 음식의 스코빌 지수를 K 이상으로 만들고 싶습니다. 모든 음식의 스코빌 지수를 K 이상으로 만들기 위해 Leo는 스코빌 지수가 가장 낮은 두 개의 음식을 아래와 같 programmers.co.kr min heap 선언방법 기억해두고 vector min_heap; 벡터나 배열은 선언시 바로 값 대입 가능! push 하면 자동으로 정렬가능 #include #include #include using namespace std; // min heap을 통해 구현 int solution(vector scoville, int K) { int answer ..
[c++] 타겟 넘버 (프로그래머스 - dfs) https://programmers.co.kr/learn/courses/30/lessons/43165# 코딩테스트 연습 - 타겟 넘버 n개의 음이 아닌 정수가 있습니다. 이 수를 적절히 더하거나 빼서 타겟 넘버를 만들려고 합니다. 예를 들어 [1, 1, 1, 1, 1]로 숫자 3을 만들려면 다음 다섯 방법을 쓸 수 있습니다. -1+1+1+1+1 = 3 +1-1+1+1+ programmers.co.kr pass by reference로 answer 변수를 넘겨줘서 해결했는데 int dfs 로 return 1 했을 땐 결과가 나오지 않아서 슬퍼하는중 #include #include using namespace std; void dfs(vector &numbers, int order, int maxOrder,..
[c++] 실패율 (프로그래머스 - 구현) https://programmers.co.kr/learn/courses/30/lessons/42889# 코딩테스트 연습 - 실패율 실패율 슈퍼 게임 개발자 오렐리는 큰 고민에 빠졌다. 그녀가 만든 프랜즈 오천성이 대성공을 거뒀지만, 요즘 신규 사용자의 수가 급감한 것이다. 원인은 신규 사용자와 기존 사용자 사이에 스 programmers.co.kr 간단한 구현 문제인데 역시 구현문제는 문제를 반드시 꼼꼼하고 꼼꼼하게 읽어야 한다는 것을 다시 깨달은 문제 ㅜ double 계산은 double로 compare 함수 만들 때 같으면 작은 번호가 먼저 오게 하는 조건을 마지막까지 못보고 있었다 ( b.second; } vector solution(int N, vector stages) { vector answer..
[c++] 신규 아이디 추천 (프로그래머스-구현) https://programmers.co.kr/learn/courses/30/lessons/72410 코딩테스트 연습 - 신규 아이디 추천 카카오에 입사한 신입 개발자 네오는 "카카오계정개발팀"에 배치되어, 카카오 서비스에 가입하는 유저들의 아이디를 생성하는 업무를 담당하게 되었습니다. "네오"에게 주어진 첫 업무는 새로 programmers.co.kr 단순한 구현 문제이지만 string STL의 여러 함수를 잘 응용하면 훨씬 쉽게 풀 수 있는 문제 #include #include #include using namespace std; string solution(string new_id) { string answer = new_id; // 1 for (int i=0; i= 'A' && answer[i] ..
[c++] string 문자열 #include 문자열에 대해 파헤쳐 봅시다 ~ ASCII 코드 가장 많이 쓰는 알파벳을 알아봅시다. A : 65 a : 97 리턴값 front, back 맨 앞 문자와 맨 뒤 문자를 뽑아주는 함수입니다. begin, end 맨 앞 iterator, 맨 뒤 iterator 입니다. find 특정 문자열을 찾으면 시작 위치를 리턴 더보기 first 'needle' found at: 14 second 'needle' found at: 44 'haystack' also found at: 30 Period found at: 51 There are two prepositions in this haystack with needles. 뒤에 붙는 숫자는 그 문자열부터 시작한다. // string::find #incl..
[스파르타코딩클럽] iOS 앱개발 기초반 1주차 Image Sets, App icon 제작 사이트 https://appicon.co App Icon Generator Generate icons and images for mobile apps, android and iOS. No need to upload or download. Works on your browser appicon.co Assistant 화면 띄우기 control + option + command + enter 배경화면 색 RGB로 바꾸기 view.backgroundColor = UIColor(red: 188 / 255.0, green: 177 / 255.0, blue: 166 / 255.0, alpha: 1) 완성본 - 손전등 앱
[WWDC 2021] Discoverable design https://developer.apple.com/videos/play/wwdc2021/10126/ Discoverable design - WWDC 2021 - Videos - Apple Developer Discover how you can create interactive, memorable experiences to onboard people into your app. We'll take you through discoverable... developer.apple.com 사용자와 상호작용이 가능하고, 기억에 남는 경험을 앱에서 제공할 수 있도록 디자인 하는 방법! 을 배우는 세션인 것 같습니다. 사용자가 앱을 사용할 때 앱의 기능을 한눈에 파악할 수 있도록 어떤 인터페이스를 제공할 수 있는지 🧐 ..
[iOS] UICollectionView https://www.youtube.com/watch?v=eWGu3hcL3ww iOS Academy - Swift for Beginners: Create Collection View in Xcode (iOS - 2021) 영상을 참고하였습니다 UICollectionView를 만들기 위해 필요한 프로토콜은 3가지가 있습니다. UICollectionViewDelegate UICollectionViewDataSource UICollectiionViewDelegateFlowLayout 딜리게이트와 데이터 소스는 테이블 뷰와 비슷하고, 플로우 레이아웃은 컬렉션뷰 셀의 모양?을 잡아주는 것입니다. 여기서 사용할 커스텀 셀의 nib 파일의 생성은 https://luen.tistory.com/89?category=91..