Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[프로그래머스] 레벨1 오답노트 #4

Open
sanhee opened this issue Jul 15, 2021 · 2 comments
Open

[프로그래머스] 레벨1 오답노트 #4

sanhee opened this issue Jul 15, 2021 · 2 comments
Assignees

Comments

@sanhee
Copy link
Owner

sanhee commented Jul 15, 2021

No description provided.

@sanhee sanhee self-assigned this Jul 15, 2021
sanhee added a commit that referenced this issue Jul 15, 2021
#3 #4

감이안와서 답지를 참고했다..
s.substring(j*i, (j*i)+i) 을 통해서 문자열을 분리하는 건 정말 신기했다!
https://fbtmdwhd33.tistory.com/226
sanhee added a commit that referenced this issue Jul 15, 2021
#3 #4

감이안와서 답지를 참고했다..
s.substring(j*i, (j*i)+i) 을 통해서 문자열을 분리하는 건 정말 신기했다!
https://fbtmdwhd33.tistory.com/226
@sanhee sanhee changed the title [프로그래머스] 틀린 문제 리스트 [프로그래머스] 레벨1, 2 틀린 문제 리스트 Jul 15, 2021
sanhee added a commit that referenced this issue Jul 15, 2021
#1 #4

생각했던게 왜 안되는지 아직 잘 모르겠다..
`if(Math.pow(sqrt, 2) == (double)n)` 으로도 충분히 비교가 가능하지 않나?
sanhee added a commit that referenced this issue Jul 15, 2021
#1 #4

처음 풀이 당시 공백을 기준으로 split을 하다보니 로직이 복잡해져서
잔실수를 했다.
sanhee added a commit that referenced this issue Jul 16, 2021
#1 #4

유클리드 호제법 자주 안사용하면 까먹을 거 같다.
이번에도 역시 저번에 공부했던 걸 참고한거 보면 주기적으로 리마인드 시켜서 체화해야할듯!
sanhee added a commit that referenced this issue Jul 16, 2021
#1 #4

프로그래머스 사이트에서 런타임 에러가 발생했다.
sanhee added a commit that referenced this issue Jul 17, 2021
#1 #4

그냥 간단하게 문자열로 변환하고, 풀었는데 다른 사람 풀이좀 참고해봐야겠다.
sanhee added a commit that referenced this issue Jul 18, 2021
#1 #4

특별하게 생각하진 않고.. 반복문 순회로 풀었다..

아래 코드 람다식으로 푼 참고 코드인데 다음에 한번 해보자!
```java
class Solution {
    public int[] solution(int[] lottos, int[] winNums) {
        return LongStream.of(
                (lottos.length + 1) - Arrays.stream(lottos).filter(l -> Arrays.stream(winNums).anyMatch(w -> w == l) || l == 0).count(),
                (lottos.length + 1) - Arrays.stream(lottos).filter(l -> Arrays.stream(winNums).anyMatch(w -> w == l)).count()
        )
                .mapToInt(op -> (int) (op > 6 ? op - 1 : op))
                .toArray();
    }
}

```
sanhee added a commit that referenced this issue Jul 19, 2021
#1 #4

많이 비효율적인 방식이다.
모듈라 연산을 이용해서, 문자열 변환없이
빠르게 할 수 있는 방법으로 다시 풀어보자.
sanhee added a commit that referenced this issue Jul 20, 2021
#1 #4

생각 못한 예외 케이스가 너무 많다....
진짜 많이 풀어봐야겠다..
sanhee added a commit that referenced this issue Jul 21, 2021
#1 #4

도저히 모르겠다. 감이 안온다...
map을 통해서 할까도 하고...

진짜 문제 이해했다고 생각했는데?..
아직 못했나보다.
sanhee added a commit that referenced this issue Jul 22, 2021
#3 #4

어제 풀이를 참고했었는데 100% 소화한게 아닌가보다..다시 풀어보자
sanhee added a commit that referenced this issue Jul 22, 2021
#3 #4

substring의 exclude함을 잊지말자
sanhee added a commit that referenced this issue Jul 22, 2021
#1 #4

실행 시간이 10.0초를 초과하여 실행이 중단되었습니다. 실행 시간이 더 짧은 다른 방법을 찾아보세요.
sanhee added a commit that referenced this issue Jul 22, 2021
#1 #4

쉽게 생각했는데, 잘안됐다.. 아직 멀었구나.ㅠㅠ
sanhee added a commit that referenced this issue Jul 22, 2021
#1 #4

Integer.parseInt 진법변환 완전 간단하게 할 수 있구나.. 처음 알았다.

```java
package com.example.programmers.레벨1._3진법뒤집기;

// 02:24
public class Solution {
    public int solution(int n) {

        StringBuilder sb = new StringBuilder();

        while (n>0) {
            sb.append(n%3);
            n = n / 3;
        }

        return Integer.parseInt(sb.toString(),3);
    }
}

```
sanhee added a commit that referenced this issue Jul 23, 2021
#1 #4

풀이를 어떻게 해야할지...너무 막푸는거 같고 잘모르겠다.
다른 사람 풀이를 봐야지!
sanhee added a commit that referenced this issue Jul 23, 2021
#1 #4

오답분석.

1. 문제에서 주어지는 조건을 잘 활용하지 못해서, 이상한데서 시간을 많이 쓰고 로직이 복잡해졌던게 크다.

ex) 주어지는 숫자는 10이 최대

2. 메소드 분리를 잘 못하면서, 메소드 분리부터 할 생각을 해서 로직이 이상하게 꼬였다. 문제를 잘 이해하고 설계가 그려질때 메소드로 분리해서 코드를 작성하자.
sanhee added a commit that referenced this issue Jul 23, 2021
#1 #4

테스트케이스는 통과했지만, 제출에서 7.7점 떴다 ㅋㅋㅋ
sanhee added a commit that referenced this issue Jul 23, 2021
#1 #4

테스트케이스는 통과했지만, 제출에서 7.7점 떴다 ㅋㅋㅋ
sanhee added a commit that referenced this issue Jul 23, 2021
#1 #4

오답분석.

- 문자를 n에 따라 이동시킬 때, 문자가 끝과 끝에서 순환되는 로직만 처리해주면 된다고 생각했다.
- 따라서, z와 Z에 관해서만 문자가 순환하도록(c - 25 + n - 1)를 처리해줬는데, 잘 생각해보니 다른 문자에서도 이동할 때 순환되는 로직을 만들어야했다.
- 너무 경험이 부족하다.
sanhee added a commit that referenced this issue Jul 23, 2021
#1 #4

정렬 문법에 아직 약하다는 것을 깨달았다.
다음에 다시 풀어보자~
sanhee added a commit that referenced this issue Jul 24, 2021
#1 #4

- 각 배열 위치가 스테이지 번호인줄 알고 착각했다..

- 정렬하는게 아직도 어색하다.
sanhee added a commit that referenced this issue Jul 24, 2021
#1 #4

오답분석.
- 실패율을 구할 때, 스테이지에 도전한 사용자가 없을 경우에 대한 예외를 안해줘서 생겼던 간단한 문제였다.
- 문제를 좀 더 잘 이해할 수 있게 꼼꼼히 봐야겠다.
sanhee added a commit that referenced this issue Jul 24, 2021
#1 #4

테스트케이스 1개를 통과못했다..
sanhee added a commit that referenced this issue Jul 24, 2021
#1 #4

ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ
@sanhee
Copy link
Owner Author

sanhee commented Jul 24, 2021

3ce2427
2e57f2e

는 커밋 메시지에 이슈 번호 잘못 입력...

sanhee added a commit that referenced this issue Jul 25, 2021
#1 #4

정규표현식 공부하기 귀찮아서, 막 풀었는데 요행바랬다가 혼난느낌이다.
sanhee added a commit that referenced this issue Jul 25, 2021
#1 #4

다시 푸니까 그래도 그나마 수월한 것 같다..
sanhee added a commit that referenced this issue Jul 25, 2021
#1 #4

좌표.. 진짜 생각한것처럼 잘안된다.. 후...
sanhee added a commit that referenced this issue Jul 25, 2021
#1 #4

오답분석..

1. 직선의 거리를 이용한 문제가 아니었다.
 - 1칸당 이동거리가 1
2. 1번이 꼬이니 중간 라인 (2,5, 8,0 )과 가까운 좌표를 찾는 로직도 덩달아 꼬였다.

- 결론은 경험을 많이 쌓아야겠다.
@sanhee sanhee changed the title [프로그래머스] 레벨1, 2 틀린 문제 리스트 [프로그래머스] 레벨1 오답노트 Jul 25, 2021
sanhee added a commit that referenced this issue Jul 25, 2021
#1 #4

간단한 정규표현식은 생각보다 어렵지 않은 것 같다.
@sanhee
Copy link
Owner Author

sanhee commented Jul 25, 2021

다음부터는 틀린 것만 기록되게 해야겠다. (너무 많아져서 보기힘들듯..)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant