Notice
Recent Posts
Recent Comments
Link
목록2023/12/29 (2)
넘치게 채우기
[LeetCode] 1335. Minimum Difficulty of a Job Schedule
https://leetcode.com/problems/minimum-difficulty-of-a-job-schedule/description/ Minimum Difficulty of a Job Schedule - LeetCode Can you solve this real interview question? Minimum Difficulty of a Job Schedule - You want to schedule a list of jobs in d days. Jobs are dependent (i.e To work on the ith job, you have to finish all the jobs j where 0
PS/LeetCode
2023. 12. 29. 19:28
Short-Circuit Evaluation: 논리연산자의 특별한 처리
프로그래밍 언어에서 if문을 자주 이용하곤 한다. 아래의 코드에서 어떤 결과가 나올까? def funcA(): print("A") return False def funcB(): print("B") return True if funcA() and funcB(): print("참") else: print("거짓") A B 거짓 A 거짓 거짓 정답은 2번이다. and논리연산을 할 때, 앞의 오퍼랜드가 false인 경우, 뒤의 오퍼랜드를 확인하지 않는다. 이 방법을 통해서 더 간결하고 가독성이 좋은 코딩을 할 수 있다. 반대로, or의 경우도 그렇다. or논리연산을 할 때, 앞의 오퍼랜드가 true인 경우, 뒤의 오퍼랜드를 확인하지 않는다. 실제 사용 예시: 알고리즘 문제풀이에서 슬라이딩 윈도우를 구현할 때 L..
컴퓨터과학
2023. 12. 29. 17:38