inblog logo
|
silver
    알고리즘문제풀기

    [알고리즘문제풀기] 간단한 논리 연산

    silver's avatar
    silver
    Sep 21, 2025
    [알고리즘문제풀기] 간단한 논리 연산
    Contents
    문제내가 작성한 정답다른 사람들의 정답

    문제

    school.programmers.co.kr
    https://school.programmers.co.kr/learn/courses/30/lessons/181917

    내가 작성한 정답

    class Solution { public boolean solution(boolean x1, boolean x2, boolean x3, boolean x4) { boolean a = true, b = true; if(!x1&&!x2) a = false; if(!x3&&!x4) b = false; return a&&b?true:false; } }

    다른 사람들의 정답

    class Solution { public boolean solution(boolean x1, boolean x2, boolean x3, boolean x4) { boolean answer = (x1||x2)&&(x3||x4); return answer; } }
    Share article

    silver

    RSS·Powered by Inblog