- Today
- Total
목록전체 글 (384)
작심삼일
문제 살다보면 해당 도메인의 ip주소가 필요할 때가 온다. 아래처럼 하면 된다. 방법 dig +short [DOMAIN] # ex) naver.com $ dig +short naver.com 223.130.195.95 223.130.200.104 223.130.200.107 223.130.195.200
문제 링크: https://leetcode.com/problems/max-area-of-island/ 문제 You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water. The area of an island is the number of cells with a value 1 in the island. Return the maximum area of an island in grid. If ther..
문제 링크: https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ 문제 Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree. 조건 1
문제 링크: https://leetcode.com/problems/binary-tree-level-order-traversal/ 문제 Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). 조건 The number of nodes in the tree is in the range [0, 2000]. -1000 List[List[int]]: if not root: return [] ans = [[]] def traversal(root, depth): if not root: return if len(ans) > depth: ans..
문제 링크: https://leetcode.com/problems/matchsticks-to-square/ 문제 You are given an integer array matchsticks where matchsticks[i] is the length of the ith matchstick. You want to use all the matchsticks to make one square. You should not break any stick, but you can link them up, and each matchstick must be used exactly one time. Return true if you can make this square and false otherwise. 조건 1 tar..
에러 opencv를 설치한 후에 import cv2를 하면 다음과 같은 에러를 만날 때가 있다. ImportError: libGL.so.1: cannot open shared object file: No such file or directory 해결 방법 apt-get install libgl1-mesa-glx 위 커맨드를 실행하면 된다. 만약 위 커맨드를 실행할 때 에러가 난다면 아래 명령어로 apt-get을 업데이트 해보자. apt-get update
문제 링크: https://leetcode.com/problems/binary-tree-right-side-view/ 문제 Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. 조건 The number of nodes in the tree is in the range [0, 100]. -100
문제 링크: https://leetcode.com/problems/interleaving-string/ 문제 Given strings s1, s2, and s3, find whether s3 is formed by an interleaving of s1 and s2. An interleaving of two strings s and t is a configuration where they are divided into non-empty substrings such that: s = s1 + s2 + ... + sn t = t1 + t2 + ... + tm |n - m|