본문 바로가기

Algorithm

(2139)
(C++) - LeetCode (easy) 1295. Find Numbers with Even Number of Digits https://leetcode.com/problems/find-numbers-with-even-number-of-digits/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 간단 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 자리수가 짝수인 개수를 셀 변수 evenNumberCount를 선언해줍니다. 📔 풀이과정 nums의 원소를 ..
(C++) - LeetCode (easy) 1290. Convert Binary Number in a Linked List to Integer https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 자료구조 linked list를 이용한 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. 정답 변수 decimal을 선언 후 0으로 초기화해줍니다..
(C++) - LeetCode (easy) 1287. Element Appearing More Than 25% In Sorted Array https://leetcode.com/problems/element-appearing-more-than-25-in-sorted-array/description/ Element Appearing More Than 25% In Sorted Array - LeetCode Can you solve this real interview question? Element Appearing More Than 25% In Sorted Array - Given an integer array sorted in non-decreasing order, there is exactly one integer in the array that occurs more than 25% of the time, return that integer..
(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..