본문 바로가기

Algorithm

(2139)
(C++) - LeetCode (easy) 867. Transpose Matrix https://leetcode.com/problems/transpose-matrix/description/ Transpose Matrix - LeetCode Can you solve this real interview question? Transpose Matrix - Given a 2D integer array matrix, return the transpose of matrix. The transpose of a matrix is the matrix flipped over its main diagonal, switching the matrix's row and column indices. [https:// leetcode.com 📕 풀이방법 📔 입력 및 초기화 matrix의 행을 열로 열을 행으로 2..
(C++) - LeetCode (easy) 860. Lemonade Change https://leetcode.com/problems/lemonade-change/description/ Lemonade Change - LeetCode Can you solve this real interview question? Lemonade Change - At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you and order one at a time (in the order specified by bills). Each customer will only buy one lemonade leetcode.com 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 5, 10, 20짜리 지..
(C++) - LeetCode (easy) 859. Buddy Strings https://leetcode.com/problems/buddy-strings/description/ Buddy Strings - LeetCode Can you solve this real interview question? Buddy Strings - Given two strings s and goal, return true if you can swap two letters in s so the result is equal to goal, otherwise, return false. Swapping letters is defined as taking two indices i and j (0-ind leetcode.com 문자열을 다뤄보는 문제였습니다. 📕 풀이방법 📔 풀이과정 여러 경우의 수가 있습니다..
(C++) - LeetCode (easy) 844. Backspace String Compare https://leetcode.com/problems/backspace-string-compare/description/ Backspace String Compare - LeetCode Can you solve this real interview question? Backspace String Compare - Given two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace character. Note that after backspacing an empty text, the tex leetcode.com 문자열 trim하는 구현 문제였습니다. 📕 ..
(C++) - LeetCode (easy) 836. Rectangle Overlap https://leetcode.com/problems/rectangle-overlap/description/ Rectangle Overlap - LeetCode Can you solve this real interview question? Rectangle Overlap - An axis-aligned rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) is the coordinate of its bottom-left corner, and (x2, y2) is the coordinate of its top-right corner. Its top leetcode.com 분기문을 사용해보는 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1..
(C++) - LeetCode (easy) 832. Flipping an Image https://leetcode.com/problems/flipping-an-image/description/ Flipping an Image - LeetCode Can you solve this real interview question? Flipping an Image - Given an n x n binary matrix image, flip the image horizontally, then invert it, and return the resulting image. To flip an image horizontally means that each row of the image is reversed. * F leetcode.com 구현 문제였습니다. 📕 풀이방법 📔 풀이과정 요구사항 그대로 구현해줍..
(C++) - LeetCode (easy) 830. Positions of Large Groups https://leetcode.com/problems/positions-of-large-groups/description/ Positions of Large Groups - LeetCode Can you solve this real interview question? Positions of Large Groups - In a string s of lowercase letters, these letters form consecutive groups of the same character. For example, a string like s = "abbxxxxzyy" has the groups "a", "bb", "xxxx", "z", and leetcode.com 구현 문제였습니다. 📕 풀이방법 📔 입력 ..
(C++) - LeetCode (easy) 824. Goat Latin https://leetcode.com/problems/goat-latin/description/ Goat Latin - LeetCode Can you solve this real interview question? Goat Latin - You are given a string sentence that consist of words separated by spaces. Each word consists of lowercase and uppercase letters only. We would like to convert the sentence to "Goat Latin" (a made-up leetcode.com 문자열 다루는 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. 공백 문자 ' '를 구분자로..