코딩 테스트/LeetCode

코딩 테스트/LeetCode

[4월 15일] container-with-most-water

📙 1. 문제 Link : https://leetcode.com/problems/container-with-most-water/description/ 문제 설명 You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines that together with the x-axis form a container, such that the container contains the most water. Return the maximum amount of water a ..

코딩 테스트/LeetCode

[4월 14일] Palindrome Number

📙 1. 문제 Link : https://leetcode.com/problems/palindrome-number/description/ 문제 설명 Given an integer x, return true if x is a palindrome, and false otherwise. # palindrome : An integer is a palindrome when it reads the same forward and backward. For example, 121 is a palindrome while 123 is not. 제한 사항 -2^31

코딩 테스트/LeetCode

[4월 14일] String to Integer

📙 1. 문제 Link : https://leetcode.com/problems/string-to-integer-atoi/description/ String to Integer (atoi) - LeetCode Can you solve this real interview question? String to Integer (atoi) - Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function). The algorithm for myAtoi(string s) is as follows: 1. Read leetcode.com 문제 설명 Imple..

코딩 테스트/LeetCode

[4월 11일] Reverse Integer

📙 1. 문제 Link : https://leetcode.com/problems/reverse-integer/description/ 문제 설명 Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. Assume the environment does not allow you to store 64-bit integers (signed or unsigned). 제한 사항 2 ≤ weights의 길이 ≤ 100,000 100 ≤ weights[i] ≤ ..

코딩 테스트/LeetCode

[4월 7일] Longest Palindromic Substring (Bruth Force)

📙 1. 문제 https://leetcode.com/problems/longest-palindromic-substring/description/

코딩 테스트/LeetCode

[4월 6일] Longest Substring Without Repeating Characters

1. 문제 : Longest Substring Without Repeating Characters 문제 설명 Given a string s, find the length of the longest substring without repeating characters. 제한 사항 0 =now){ now = st.lastIndexOf(it)+1; } st.push(it); }else{ st.push(it); } arr.push(st.length-now); }) return Math.max(...arr) }; s를 순환을 하며 st에 하나씩 집어 넣었다. 그리고 now라는 변수를 만들어, 문자가 곂치지 않는 마지노선을 정의하였다. => arr.push(st.length-now)로 값을 arr에 추가하였다. ..

코딩 테스트/LeetCode

[4월 6일] Add Two Numbers

1. 문제 : Add Two Numbers 문제 설명 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. 제한 사항 The number of nodes in each linked list is ..

코딩 테스트/LeetCode

[4월 2일] Two Sum

문제 : Two Sum 문제 설명 Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. 제한 사항 2

피터s
'코딩 테스트/LeetCode' 카테고리의 글 목록