이진탐색

개발공부/algorithm

[Leetcode][python] 374. Guess Number Higher or Lower - Binary Search

Problem Leetcode 374. Guess Number Higher or Lower - Binary Search Level: Easy Link Guess Number Higher or Lower - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com My Code 기본적인 Binary Search 문제이다. n = 2, pick = 2, n=1, pick 1 처럼 interval이 얼마 차이 나지 않는 경우들에 대한 조건처리가 잘 되어야 한다. # The gu..

개발공부/algorithm

[leetcode][python] 278. First Bad Version - Binary Search

Problem Leetcode 278: First Bad version Level: Easy Link First Bad Version - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com My Code 기본적인 이진탐색 문제다. 이진 탐색을 진행해주며 가장 먼저 발생하는 bad version을 체크해준다. # The isBadVersion API is already defined for you. # @param version, an integer # @return ..

so.py
'이진탐색' 태그의 글 목록