본문 바로가기

👨‍💻 DS & Algo17

[leetcode/JS] 232_Implement Queue using Stacks 풀이 🎲 문제 Implement Queue using Stacks - 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 232. Implement Queue using Stacks Easy 두 개의 스택만 사용하여 선입선출(FIFO) 큐(Queue)를 구현합니다. 구현된 큐은 일반 큐의 모든 기능을 지원해야 합니다. (push, peek, pop, and empty) the MyQueue class 구현: void push(int x) 요소 x를 큐의 뒤쪽으로 푸시합니다.. 2022. 11. 20.
[leetcode/JS] 283_Move Zeroes 풀이 🎲 문제 Move Zeroes - 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 283. Move Zeroes Easy 정수 배열 nums가 주어지면 0이 아닌 요소의 상대적인 순서를 유지하면서 모든 0을 끝으로 이동합니다. 배열의 복사본을 만들지 않고 이 작업을 제자리에서 수행해야 합니다. 더보기 Given an integer array nums, move all 0's to the end of it while maintaining the relative or.. 2022. 11. 20.
[leetcode/JS] 122_Best Time to Buy and Sell Stock II 풀이 🎲 문제 Best Time to Buy and Sell Stock II - 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 122. Best Time to Buy and Sell Stock II Medium price[i]가 i번째 날의 주어진 주식 가격인 정수 배열 price가 주어집니다. 매일 주식을 매수 및 / 또는 매도하기로 결정할 수 있습니다. 언제든지 최대 한 주식만 보유할 수 있습니다. 단, 매수 후 당일 매도가 가능합니다. 달성할 수 있는 최대 이익.. 2022. 11. 16.
[leetcode/JS] 744_Find Smallest Letter Greater Than Target 풀이 🎲 문제 Find Smallest Letter Greater Than Target - 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 744. Find Smallest Letter Greater Than Target Easy 내림차순으로 정렬된 "letters" 문자 배열과 "target" 문자가 제공됩니다. "letters"에는 적어도 두 개의 다른 문자가 있습니다. 사전 순으로 "target"보다 큰 "letters"에서 가장 작은 문자를 반환합니다. 이러한 .. 2022. 11. 16.
[leetcode/JS] 278_First Vad Version 풀이 🎲 문제 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 278. First Bad Version Easy 당신은 제품 관리자이며 현재 새 제품을 개발하는 팀을 이끌고 있습니다. 안타깝게도 최신 버전의 제품은 품질 검사에 실패했습니다. 각 버전은 이전 버전을 기반으로 개발되기 때문에 나쁜 버전 이후의 모든 버전도 나쁜 것입니다. n개의 버전 [1, 2, ..., n]이 있고 첫 번째 잘못된 버전을 찾고자 한다고 가정합니다. 버전.. 2022. 11. 16.
[leetcode/JS] 2_Add Two Numbers 풀이 🎲 문제 Add Two Numbers - 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 2. Add Two Numbers Medium 음수가 아닌 두 정수를 나타내는 비어 있지 않은 연결 목록이 두 개 제공됩니다. 숫자는 역순으로 저장되며 각 노드는 하나의 숫자를 포함합니다. 두 숫자를 더하고 합계를 연결 리스트로 돌려주세요. 숫자 0 자체를 제외하고 두 숫자가 선행 0을 포함하지 않는다고 가정할 수 있습니다. 더보기 You are given two non-em.. 2022. 11. 13.