File tree Expand file tree Collapse file tree 2 files changed +111
-0
lines changed Expand file tree Collapse file tree 2 files changed +111
-0
lines changed Original file line number Diff line number Diff line change 1+ # 연관 링크
2+ - [ 문제 풀이 스케줄] ( https://github.com/orgs/DaleStudy/projects/6/views/5 )
3+ - [ 답안 코드 제출법] ( https://github.com/DaleStudy/leetcode-study/wiki/%EB%8B%B5%EC%95%88-%EC%A0%9C%EC%B6%9C-%EA%B0%80%EC%9D%B4%EB%93%9C )
4+
5+ # Problem
6+ - 문제 링크 : https://leetcode.com/problems/number-of-1-bits/description/
7+ - 문제 이름 : Number of 1 Bits
8+ - 문제 번호 : 191
9+ - 난이도 : easy
10+ - 카테고리 :
11+
12+ # 문제 설명
13+ - 2진수 자릿수 처리
14+ - 2로 나눠 나머지 고려 및 몇번 나눠지는지 고려가 필요
15+
16+ # 아이디어
17+ - brute force
18+
19+ # ✅ 코드 (Solution)
20+
21+ ``` cpp
22+ class Solution {
23+ public:
24+ int hammingWeight(int n) {
25+ int res = 0;
26+ while(n>0){
27+ if(n%2==1){
28+ res++;
29+ n--;
30+ }
31+ n = n/2;
32+ }
33+ return res;
34+ }
35+ };
36+ ```
37+
38+ # 🔍 코드 설명
39+
40+ brute force
41+
42+ # 최적화 포인트 (Optimality Discussion)
43+ • 최적화한 이유와 원리
44+ • 더 줄일 수 있는 여지는 있는가?
45+ • 기존 방법 대비 얼마나 효율적이었는지
46+
47+ # 🧪 테스트 & 엣지 케이스
48+
49+ # 📚 관련 지식 복습
50+
51+ # 🔁 회고
52+
53+
Original file line number Diff line number Diff line change 1+ # 연관 링크
2+ - [ 문제 풀이 스케줄] ( https://github.com/orgs/DaleStudy/projects/6/views/5 )
3+ - [ 답안 코드 제출법] ( https://github.com/DaleStudy/leetcode-study/wiki/%EB%8B%B5%EC%95%88-%EC%A0%9C%EC%B6%9C-%EA%B0%80%EC%9D%B4%EB%93%9C )
4+
5+ # Problem
6+ - 문제 링크 : https://leetcode.com/problems/valid-palindrome/description/
7+ - 문제 이름 : 125. Valid Palindrome
8+ - 문제 번호 : 125
9+ - 난이도 : easy
10+ - 카테고리 :
11+
12+ # 문제 설명
13+
14+
15+ # 아이디어
16+ - brute force
17+
18+ # ✅ 코드 (Solution)
19+
20+ ``` cpp
21+ class Solution {
22+ public:
23+ bool isPalindrome(string s) {
24+ vector<char > pureAlphabat;
25+ for(auto cur: s){
26+ if(cur >= 'a' && cur <='z'){
27+ pureAlphabat.push_back(cur);
28+ }else if(cur>= 'A' && cur <='Z'){
29+ pureAlphabat.push_back(cur-'A'+'a');
30+ }else if(cur>='0' && cur<='9'){
31+ pureAlphabat.push_back(cur);
32+ }
33+ }
34+ for(int i=0;i<pureAlphabat.size();i++){
35+ if(pureAlphabat[ i] != pureAlphabat[ pureAlphabat.size()-1-i] ){
36+ return false;
37+ }
38+ }
39+ return true;
40+ }
41+ };
42+ ```
43+
44+ # 🔍 코드 설명
45+
46+
47+ # 최적화 포인트 (Optimality Discussion)
48+ • 최적화한 이유와 원리
49+ • 더 줄일 수 있는 여지는 있는가?
50+ • 기존 방법 대비 얼마나 효율적이었는지
51+
52+ # 🧪 테스트 & 엣지 케이스
53+
54+ # 📚 관련 지식 복습
55+
56+ # 🔁 회고
57+
58+
You can’t perform that action at this time.
0 commit comments