코딩 테스트

코딩 테스트/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

코딩 테스트/프로그래머스

[4월 2일] 시소 짝꿍

문제 1. 시소 짝꿍 문제 설명 어느 공원 놀이터에는 시소가 하나 설치되어 있습니다. 이 시소는 중심으로부터 2(m), 3(m), 4(m) 거리의 지점에 좌석이 하나씩 있습니다. 이 시소를 두 명이 마주 보고 탄다고 할 때, 시소가 평형인 상태에서 각각에 의해 시소에 걸리는 토크의 크기가 서로 상쇄되어 완전한 균형을 이룰 수 있다면 그 두 사람을 시소 짝꿍이라고 합니다. 즉, 탑승한 사람의 무게와 시소 축과 좌석 간의 거리의 곱이 양쪽 다 같다면 시소 짝꿍이라고 할 수 있습니다. 사람들의 몸무게 목록 weights이 주어질 때, 시소 짝꿍이 몇 쌍 존재하는지 구하여 return 하도록 solution 함수를 완성해주세요. 제한 사항 2 ≤ weights의 길이 ≤ 100,000 100 ≤ weights[..

피터s
'코딩 테스트' 카테고리의 글 목록 (3 Page)