본문 바로가기

Algorithm/Implementation

(517)
(Python) - LeetCode (easy) 1281. Subtract the Product and Sum of Digits of an Integer https://leetcode.com/problems/subtract-the-product-and-sum-of-digits-of-an-integer/description/ Subtract the Product and Sum of Digits of an Integer - LeetCode Can you solve this real interview question? Subtract the Product and Sum of Digits of an Integer - Given an integer number n, return the difference between the product of its digits and the sum of its digits. Example 1: Input: n = 234 Out..
(C++) - LeetCode (easy) 1275. Find Winner on a Tic Tac Toe Game https://leetcode.com/problems/find-winner-on-a-tic-tac-toe-game/description/ Find Winner on a Tic Tac Toe Game - LeetCode Can you solve this real interview question? Find Winner on a Tic Tac Toe Game - Tic-tac-toe is played by two players A and B on a 3 x 3 grid. The rules of Tic-Tac-Toe are: * Players take turns placing characters into empty squares ' '. * The first player A leetcode.com 간단 구현 ..
(C++) - LeetCode (easy) 1266. Minimum Time Visiting All Points https://leetcode.com/problems/minimum-time-visiting-all-points/description/ Minimum Time Visiting All Points - LeetCode Can you solve this real interview question? Minimum Time Visiting All Points - On a 2D plane, there are n points with integer coordinates points[i] = [xi, yi]. Return the minimum time in seconds to visit all the points in the order given by points. You can leetcode.com vector를 ..
(C++) - LeetCode (easy) 1252. Cells with Odd Values in a Matrix https://leetcode.com/problems/cells-with-odd-values-in-a-matrix/description/ Cells with Odd Values in a Matrix - LeetCode Can you solve this real interview question? Cells with Odd Values in a Matrix - There is an m x n matrix that is initialized to all 0's. There is also a 2D array indices where each indices[i] = [ri, ci] represents a 0-indexed location to perform some incre leetcode.com 행렬 구현 ..
(C++) - LeetCode (easy) 1260. Shift 2D Grid https://leetcode.com/problems/shift-2d-grid/description/ Shift 2D Grid - LeetCode Can you solve this real interview question? Shift 2D Grid - Given a 2D grid of size m x n and an integer k. You need to shift the grid k times. In one shift operation: * Element at grid[i][j] moves to grid[i][j + 1]. * Element at grid[i][n - 1] moves to leetcode.com 행렬 동작 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 바뀐 행렬 shiftedG..
(C++) - LeetCode (easy) 1221. Split a String in Balanced Strings https://leetcode.com/problems/split-a-string-in-balanced-strings/description/ Split a String in Balanced Strings - LeetCode Can you solve this real interview question? Split a String in Balanced Strings - Balanced strings are those that have an equal quantity of 'L' and 'R' characters. Given a balanced string s, split it into some number of substrings such that: * Each substrin leetcode.com 간단 구..
(C++) - LeetCode (easy) 1207. Unique Number of Occurrences https://leetcode.com/problems/unique-number-of-occurrences/ Unique Number of Occurrences - LeetCode Can you solve this real interview question? Unique Number of Occurrences - Given an array of integers arr, return true if the number of occurrences of each value in the array is unique or false otherwise. Example 1: Input: arr = [1,2,2,1,1,3] Output: tr leetcode.com 자료구조를 이용한 문제였습니다. 📕 풀이방법 📔 입력 및..
(C++) - LeetCode (easy) 1200. Minimum Absolute Difference https://leetcode.com/problems/minimum-absolute-difference/ Minimum Absolute Difference - LeetCode Can you solve this real interview question? Minimum Absolute Difference - Given an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements. Return a list of pairs in ascending order(with respect t leetcode.com 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1..