320x100

코딩테스트 준비 66

1775. Equal Sum Arrays With Minimum Number of Operations [Medium]

https://leetcode.com/problems/equal-sum-arrays-with-minimum-number-of-operations/ Equal Sum Arrays With Minimum Number of Operations - 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 1부터 6까지의 목록을 주고, 각 목록의 요소 값을 한 번에 1~6 중에서 임의로 변경시킬 수 있다고 할 때, 두 목록의 합을 같게 만드는데 몇번의 과정이 필요한지 구하는 문제이..

36. Valid Sudoku [Medium]

https://leetcode.com/problems/valid-sudoku/ Valid Sudoku - 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 문제를 요약하자면 Input으로 주어진 스도쿠 데이터의 현재까지 상태가 규칙에 맞는지 아닌지를 판별하면 되는 문제. 스도쿠의 규칙은 1. 한 가로줄에 중복되는 숫자가 없을 것 2. 한 세로줄에 중복되는 숫자가 없을 것 3. 겹치지 않는 3x3 칸 안에 중복되는 숫자가 없을 것 3가지다. bool isValidSu..

101. Symmetric Tree [Easy]

https://leetcode.com/problems/symmetric-tree/ Symmetric Tree - 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 트리가 가운데 세로를 기준으로 대칭형인가 판별하는 문제인데 요약하자면 왼쪽의 왼쪽과 오른쪽의 오른쪽이 같아야 하고, 왼쪽의 오른쪽과 오른쪽의 왼쪽이 같아야 한다. class Solution { public: bool compareSubTree(TreeNode* left, TreeNode* right) { ..

1753. Maximum Score From Removing Stones [Medium]

https://leetcode.com/problems/maximum-score-from-removing-stones/ Maximum Score From Removing Stones - 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 각각 a,b,c 크기의 돌 더미 3개로 솔리테어 게임(?)을 하는데, 매 턴마다 비어있지 않은 2개의 돌 더미에서 각각 1개씩 빼야한다. 비어있는 더미가 2개가 되면 게임은 종료된다. 결국 최대 진행 가능한 턴 수를 구하는 문제다. 요..

112. Path Sum [Easy]

https://leetcode.com/problems/path-sum/ Path Sum - 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 이진 트리의 루트와 목표 합이 주어졌을 때, root부터 leaf 노드까지 모든 노드의 합이 목표 계와 동일한지 판단하는 문제다. /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; *..

320x100