Home
My Technical Diary
Cancel

LeetCode - 1143. Longest Common Subsequence

1143. Longest Common Subsequence - medium 문제 Given two strings text1 and text2, return the length of their longest common subsequence. A subsequence of a string is a new string generated from ...

LeetCode - 599. Minimum Index Sum of Two Lists

599. Minimum Index Sum of Two Lists - easy 문제 Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need ...

LeetCode - 1389. Create Target Array in the Given Order

1389. Create Target Array in the Given Order - easy 문제 Given two arrays of integers nums and index. Your task is to create target array under the following rules: Initially target array is ...

LeetCode - 1232. Check If It Is a Straight Line

1232. Check If It Is a Straight Line - easy 문제 You are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a stra...

LeetCode - 993. Cousins in Binary Tree

993. Cousins in Binary Tree - easy 문제 In a binary tree, the root node is at depth 0, and children of each depth k node are at depth k+1. Two nodes of a binary tree are cousins if they have the...

LeetCode - 169. Majority Element

169. Majority Element - easy 문제 Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is ...

LeetCode - 387. First Unique Character in a String

387. First Unique Character in a String - easy 문제 Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1. 제한사항 입출력 예 Example : s...

LeetCode - 476. Number Complement

476. Number Complement - easy 문제 Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. 제한사항 The given integer is...

Effective C++ - Item.8

예외가 소멸자를 떠나지 못하도록 붙잡아 놓자 내용 예외 발생시 소멸자의 입장 소멸자에서 예외가 터져 나가는 경우를 C++ 언어에서 막는 것은 아니지만, 실제 상황을 들춰보면 확실히 프로그래머가 직접 막을 수 밖에 없다. class Widget { public: ~Widget() { ... } ... }; void doSometh...

Effective C++ - Item.7

다형성을 가진 기본 클래스에서는 소멸자를 반드시 가상 소멸자로 선언하자 내용 가상 소멸자 C++의 규정에 의하면, 기본 클래스 포인터를 통해 파생 클래스 객체가 삭제 될때, 그 기본 클래스에 비가상 소멸자가 있으면 프로그램 동작은 미정의 사항이라고 되어 있다. 대개 그 객체의 파생 클래스 부분이 소멸되지 않게 된다. 이러한 문제를 해결하기 ...