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

[java] boj 11140 #16

Merged
merged 1 commit into from
Jul 22, 2023
Merged

[java] boj 11140 #16

merged 1 commit into from
Jul 22, 2023

Conversation

Yg-Hong
Copy link
Contributor

@Yg-Hong Yg-Hong commented Jul 15, 2023

πŸ“£ Related Issue

🌁 Background

λ°±μ€€ 싀버 III String 문제 풀이

πŸ‘©β€πŸ’» Contents

λ°±μ€€ 11140

public class Baekjoon_11140 {
    public static void main(String args[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int T = Integer.parseInt(br.readLine());

        for (int test_case = 1; test_case <= T; test_case++) {
            int result = 3;

            String str = br.readLine();
            String REGEXP_PATTERN_STRING = "[a-z]*l[a-z]l[a-z]*";
            for (int i = 1; i <= 3; i++) {
                for (int j = 0; j < str.length() - i + 1; j++) {
                    String temp = str.substring(j, j + i);
                    /*System.out.println(temp);*/

                    if(temp.equals("o") || (temp.equals("l"))) result = 2;
                    if(temp.equals("lo") || temp.equals("ol") || temp.equals("ll")) result = 1;
                    if(Pattern.matches(REGEXP_PATTERN_STRING, temp)) result = 1;
                    if(temp.equals("lol")) result = 0;
                }
            }

            System.out.println(result);
        }
    }
}

πŸ“± Screenshot

πŸ“ Review Note

λ¬Έμžμ—΄ λ„ˆλ¬΄ 약점이닀. μ΄λ²ˆμ— ν† μŠ€ μ„œλ²„ μ½”ν…Œλ„ λ¬Έμžμ—΄λ‘œ ν‘ΈλŠ” λ¬Έμ œλŠ” 손 댈 엄두도 λͺ»λ‚΄κ³  λ‹€μŒ 문제둜 일단 λ„˜κ²Όλ‹€. λΆ€μ‘±ν•œκ±΄ μΈμ •ν•˜κ³  μ—°μŠ΅ν•˜λ©΄ κ·Έλ§Œμ΄λ‹€. μ •κ·œν‘œν˜„μ‹λΆ€ν„° κ³΅λΆ€ν•˜κ³  λ¬Έμžμ—΄ μ—¬λŸ¬ 문제λ₯Ό ν’€μ–΄λ³Ό 것이닀..

πŸ“¬ Reference

μžλ°” μ •κ·œν‘œν˜„μ‹

@Yg-Hong Yg-Hong requested a review from a team as a code owner July 15, 2023 13:29
@Yg-Hong Yg-Hong requested review from ChaCha3088 and gseokj and removed request for a team July 15, 2023 13:29
@Yg-Hong Yg-Hong added the λ°±μ€€ λ°±μ€€ 문제 label Jul 15, 2023
Copy link
Member

@minjae9610 minjae9610 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μ •κ·œν‘œν˜„μ‹μ€ 정말 해도해도 ν•  λ•Œλ§ˆλ‹€ κ²€μƒ‰ν•˜κ²Œ λ§Œλ“œλŠ”...
κ·Έλž˜λ„ ν•  쀄 μ•Œλ©΄ 정말 νŽΈν•΄μ§€λŠ”κ²ƒ κ°™κΈ°λŠ” ν•΄μš” πŸ‘

@minjae9610 minjae9610 added the μ•Œκ³ λ¦¬μ¦˜ μ•Œκ³ λ¦¬μ¦˜ 문제 label Jul 15, 2023
@minjae9610 minjae9610 removed the request for review from gseokj July 21, 2023 02:15
Copy link
Contributor

@ChaCha3088 ChaCha3088 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μ •κ·œμ‹ μ¨μ•Όν•˜λŠ” λ¬Έμ œλ„ λ‚˜μ˜€λŠ”κ΅°μš”?

잘 λ΄€μŠ΄λ‹€.

@Yg-Hong Yg-Hong merged commit efe3ddc into main Jul 22, 2023
1 check passed
@Yg-Hong Yg-Hong deleted the algo/lion0077v/boj11140 branch July 22, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#λ¬Έμžμ—΄ λ°±μ€€ λ°±μ€€ 문제 μ•Œκ³ λ¦¬μ¦˜ μ•Œκ³ λ¦¬μ¦˜ 문제
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants