본문 바로가기

IT59

[LeetCode] 70. Climbing Stairs You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Example 1: Input: n = 2 Output: 2 Explanation: There are two ways to climb to the top. 1. 1 step + 1 step 2. 2 steps Example 2: Input: n = 3 Output: 3 Explanation: There are three ways to climb to the top. 1. 1 step + 1 step + 1 step 2... 2022. 8. 19.
[LeetCode] 69. Sqrt(x) Given a non-negative integer x, compute and return the square root of x. Since the return type is an integer, the decimal digits are truncated, and only the integer part of the result is returned. Note: You are not allowed to use any built-in exponent function or operator, such as pow(x, 0.5) or x ** 0.5. Example 1: Input: x = 4 Output: 2 Example 2: Input: x = 8 Output: 2 Explanation: The square.. 2022. 8. 19.
[LeetCode] 67. Add Binary Given two binary strings a and b, return their sum as a binary string. Example 1: Input: a = "11", b = "1" Output: "100" Example 2: Input: a = "1010", b = "1011" Output: "10101" Constraints: 1 2022. 8. 19.
[LeetCode] 66. Plus One You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0's. Increment the large integer by one and return the resulting array of digits. Example 1: Input: digits = [1,2,3] Output: [1,2,4] Expl.. 2022. 8. 19.
[LeetCode] 64. Minimum Path Sum Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path. Note: You can only move either down or right at any point in time. Example 1: Input: grid = [[1,3,1],[1,5,1],[4,2,1]] Output: 7 Explanation: Because the path 1 → 3 → 1 → 1 → 1 minimizes the sum. Example 2: Input: grid = [[1,2,3],[4,5,6]] Output: 1.. 2022. 8. 17.
[LeetCode] 63. Unique Paths II You are given an m x n integer array grid. There is a robot initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m-1][n-1]). The robot can only move either down or right at any point in time. An obstacle and space are marked as 1 or 0 respectively in grid. A path that the robot takes cannot include any square that is an obsta.. 2022. 8. 17.
[LeetCode] 62. Unique Paths There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m - 1][n - 1]). The robot can only move either down or right at any point in time. Given the two integers m and n, return the number of possible unique paths that the robot can take to reach the bottom-right corner. The test c.. 2022. 8. 17.
[Spring][전문가를 위한 스프링 5] CH2. 스프링 시작하기 전문가를 위한 스프링 5(Pro Spring 5) - Ch 2. 스프링 시작하기 2.1 스프링 프레임워크 가져오기 Maven, Gradle 같은 빌드 도구를 사용 || Github에서 Spring Library Checkout 후 사용 사용하려는 Spring에 적절한 JDK 사용하기 JVM(Java Virtual Machine) : 구현이 필요한 abstract machine, 자바 바이트 코드가 실행될 수 있는 실행 환경 제공하는 사양 JRE(Java Runtime Environment) : 실행 환경을 제공하는데 사용, JVM의 실제 구현체 JDK(Java Development Kit) : JRE, 메뉴얼 및 자바 도구들을 담고 있는 것 JDK12 이상, Spring 5.1.8 사용 2.2 스프링 모.. 2022. 8. 15.
[LeetCode] 58. Length of Last Word Given a string s consisting of words and spaces, return the length of the last word in the string. A word is a maximal substring consisting of non-space characters only. Example 1: Input: s = "Hello World" Output: 5 Explanation: The last word is "World" with length 5. Example 2: Input: s = " fly me to the moon " Output: 4 Explanation: The last word is "moon" with length 4. Example 3: Input: s = .. 2022. 8. 15.
반응형