본문 바로가기

Algorithm/Brute Force

(118)
(C++) - LeetCode (easy) 496. Next Greater Element I https://leetcode.com/problems/next-greater-element-i/description/ Next Greater Element I - LeetCode Can you solve this real interview question? Next Greater Element I - The next greater element of some element x in an array is the first greater element that is to the right of x in the same array. You are given two distinct 0-indexed integer arrays nums1 leetcode.com 전수조사 문제였습니다. 📕 풀이방법 📔 입력 및 초기..
(C++) - LeetCode (easy) 463. Island Perimeter https://leetcode.com/problems/island-perimeter/description/ Island Perimeter - LeetCode Can you solve this real interview question? Island Perimeter - You are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The leetcode.com 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. 4방향을 검사할 ..
(C++) - LeetCode (easy) 1539. Kth Missing Positive Number https://leetcode.com/problems/kth-missing-positive-number/description/ Kth Missing Positive Number - LeetCode Can you solve this real interview question? Kth Missing Positive Number - Given an array arr of positive integers sorted in a strictly increasing order, and an integer k. Return the kth positive integer that is missing from this array. Example 1: Input: leetcode.com 전수조사 문제였습니다. 📕 풀이방법 📔..
(C++) - LeetCode (easy) 401. Binary Watch https://leetcode.com/problems/binary-watch/description/ Binary Watch - LeetCode Can you solve this real interview question? Binary Watch - A binary watch has 4 LEDs on the top to represent the hours (0-11), and 6 LEDs on the bottom to represent the minutes (0-59). Each LED represents a zero or one, with the least significant bit on t leetcode.com 전수조사 문제였습니다. 📕 풀이방법 📔 풀이과정 2진수 단위로 bit가 켜지고 꺼지기 때..
(C++) - LeetCode (easy) 389. Find the Difference https://leetcode.com/problems/is-subsequence/description/ Is Subsequence - LeetCode Can you solve this real interview question? Is Subsequence - Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is formed from the original string by deleting some (can be n leetcode.com 전수조사 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 s의 처음부터 시작할 변..
(C++) - LeetCode (easy) 389. Find the Difference https://leetcode.com/problems/find-the-difference/description/ Find the Difference - LeetCode Can you solve this real interview question? Find the Difference - You are given two strings s and t. String t is generated by random shuffling string s and then add one more letter at a random position. Return the letter that was added to t. Example 1: leetcode.com 전수조사 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 정답 변수 a..
(C++) - LeetCode (easy) 350. Intersection of Two Arrays II https://leetcode.com/problems/intersection-of-two-arrays-ii/description/ Intersection of Two Arrays II - LeetCode Intersection of Two Arrays II - Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it shows in both arrays and you may return the result in any order. Example 1: Input leetcode.com 전수조사 문제였습니다. 📕 풀이..
(C++) - LeetCode (easy) 349. Intersection of Two Arrays https://leetcode.com/problems/intersection-of-two-arrays/description/ Intersection of Two Arrays - LeetCode Can you solve this real interview question? Intersection of Two Arrays - Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must be unique and you may return the result in any order. Example 1: In leetcode.com 간단 전수조사 문제였습니다. 📕 풀이방법 ..