Given an array of strings strs, group the anagrams together. You can return the answer in any order.An Anagram is a word or phrase formed by rearrang
Given a string s, return the longest palindromic substring in s.
Given an integer array nums, return all the triplets \[nums\[i], nums\[j]. nums\[k]] such that i != j, i != k, and j != k, and nums\[i] + nums\[j] + n
Given an integer array nums of 2n integers, group these integers into n pairs (a1, b1), (a2, b2), ..., (an, bn) such that the sum of min(ai, bi) for
Given the head of a singly linked list, return true if it is a palindrome or false other wise.
Given the head of a singly linked list, reverse the list, and return the reversed list.
You are given the heads of two sorted linked lists list1 and list2. Merge the two lists into one sorted list. The list should be made by splicing...
Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordere
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
스택 (stack)은 기본적인 자료구조 중 하나로, 컴퓨터 프로그램을 작성할 때 자주 이용되는 개념이다. 스택은 자료를 넣는 (push) 입구와 자료를 뽑는 (pop) 입구가 같아 제일 나중에 들
Given a string s, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the smallest in lexicog
Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have t
여러분도 알다시피 여러분의 프린터 기기는 여러분이 인쇄하고자 하는 문서를 인쇄 명령을 받은 ‘순서대로’, 즉 먼저 요청된 것을 먼저 인쇄한다.
225\. Implement Stack using Queues 232\. Implement Queue using StacksFollow-up: Can you implement the stack using only one queue?queue 를 두 개 이용하여 sta
https://leetcode.com/problems/jewels-and-stones/ > You're given strings jewels repersenting the types of stones that are jewels, and stones repersent
https://leetcode.com/problems/top-k-frequent-elements/Given an integer array nums and an integer k, return the k most frequent elements. You may
<그림 1>과 같이 정사각형 모양의 지도가 있다. 1은 집이 있는 곳을, 0은 집이 없는 곳을 나타낸다. 철수는 이 지도를 가지고 연결된 집의 모임인 단지를 정의하고, 단지에 번호를 붙이려 한다. 여기서 연결되었다는 것은 어떤 집이 좌우, 혹은 아래위로 다른 집이 있는
https://www.acmicpc.net/submit/9663N-Queen 문제는 크기가 N × N인 체스판 위에 퀸 N개를 서로 공격할 수 없게 놓는 문제이다.N이 주어졌을 때, 퀸을 놓는 방법의 수를 구하는 프로그램을 작성하시오.퀸이 배치될 수 있는 모든
https://www.acmicpc.net/problem/1759바로 어제 최백준 조교가 방 열쇠를 주머니에 넣은 채 깜빡하고 서울로 가 버리는 황당한 상황에 직면한 조교들은, 702호에 새로운 보안 시스템을 설치하기로 하였다. 이 보안 시스템은 열쇠가 아닌
https://www.acmicpc.net/problem/9095정수 4를 1, 2, 3의 합으로 나타내는 방법은 총 7가지가 있다. 합을 나타낼 때는 수를 1개 이상 사용해야 한다.1+1+1+1전체적인 재귀문의 흐름은 위 그림과 같다. dfs(i) 가 호출되
https://leetcode.com/problems/invert-binary-tree/ >Given the root of a binary tree, invert the tree, and return its root.
https://leetcode.com/problems/longest-univalue-path/Given the root of a binary tree, return the length of the longest path, where each node in th
https://leetcode.com/problems/serialize-and-deserialize-binary-tree/Serialization is the process of converting a data structure or object into a
https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/You are given an m x n binary matrix mat of 1's (representing soldiers) and 0's (rep
알파벳 소문자로 이루어진 N개의 단어가 들어오면 아래와 같은 조건에 따라 정렬하는 프로그램을 작성하시오. 1\. 길이가 짧은 것부터 2. 길이가 같으면 사전 순으로단, 중복된 단어는 하나만 남기고 제거해야 한다.문자열이 있는 리스트에 sort()를 사용하면 사전 순서로
https://leetcode.com/problems/network-delay-time/k노드가 다른 모든 노드와 연결되어 있다면 최장 경로의 값을 반환하고, 아닐 경우 -1을 반환한다.최단 거리 탐색과 관련된 문제이므로 다익스트라 알고리즘을 활용할 수 있다.
https://www.acmicpc.net/problem/1956주어진 그래프의 모든 노드에서 자기자신으로 이어지는 경로 중 최단 경로를 찾는 문제이므로 플로이드-워셜 알고리즘으로 풀 수 있다.보통의 경우 자기 자신으로 돌아오는 루트를 계산에서 제외하기 위해