algorithm
[Algorithm] LeetCode 63. Unique Paths 2 (java)
풀이 코드 class Solution { public int uniquePathsWithObstacles(int[][] obstacleGrid) { int m = obstacleGrid.length; int n = obstacleGrid[0].length; if (obstacleGrid[0][0] == 1) return 0; obstacleGrid[0][0] = 1; for (int x = 1; x 사고 과정 https://leetcode.com/problems/unique-paths-ii 앞서 풀었던 Unique Paths 1과 동일하지만, 중간에 장애물이 있다는 조건이 추가되었다. (이전 1편에서도 중학교 수학 길찾기 문제에서..
[A100C_day 1] Leetcode 704. Binary Search (java)
문제 링크 https://leetcode.com/problems/binary-search/ LeetCode - The World's Leading Online Programming Learning Platform 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 문제 분석 1. 먼저 주어진 nums는 sorted array -> 이제 기본적으로 Binary Search가 가장 먼저 떠올라야 한다. 2. 1