- Today
- Total
목록전체 글 (384)
작심삼일
문제 링크: https://leetcode.com/problems/rotate-image/ 문제 You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation. 조건 n == matrix.length == matrix[i].length 1
문제 링크: https://leetcode.com/problems/number-of-islands/ 문제 Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. 조건 m == grid.length n == grid[i].length 1
문제 링크: https://leetcode.com/problems/ransom-note/ Ransom Note - LeetCode 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 문제 Given two strings ransomNote and magazine, return true if ransomNote can be constructed by using the letters from magazine and false otherwise. Each letter in magazine..
문제 링크: https://leetcode.com/problems/power-of-three/ 문제 Given an integer n, return true if it is a power of three. Otherwise, return false. An integer n is a power of three, if there exists an integer x such that n == $3^x$. 조건 $-2^{31}$ 1: remain = n % 3 if remain > 0: return False n = n // 3 return True
문제 링크: https://leetcode.com/problems/reduce-array-size-to-the-half/ 문제 You are given an integer array arr. You can choose a set of integers and remove all the occurrences of these integers in the array. Return the minimum size of the set so that at least half of the integers of the array are removed. 조건 2
에러 난 docker에서 DistributedSampler같은 distributed어쩌구를 실행시킬 때 오류가 발생했다. (dataloader였나..) OSError: [Errno 28] No space left on device 해결 방법 말만 보면 장치에 남은 공간이 없다는데, 확인해보면 공간이 많다. docker에 할당된 것과, 실제 docker가 돌아가는 부분이 나뉘어있어서 이런 에러가 난다. 해결방안은 두가지가 있다. 1. docker를 생성할 때 docker run 어쩌구 뒤에 아래 커맨드를 붙인다. # docker 생성 시 --ipc=host 2. num_worker를 0으로 한다. num_workers=0
에러 단순히 pip -r requirements.txt를 실행시켰는데 이런 에러가 나온다. ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. PyYAML을 삭제 후 다른 버전으로 재설치할 때 생기는 오류다. 해결방법 PyYAML을 무시하고 PyYAML을 재설치한 뒤, 다시 다른 것들을 설치하면 해결된다. pip install --ignore-installed PyYAML 물론 이 방법이 찜찜할 것이다. 하지만 더 좋은 방법을 아직 찾지..
문제 링크: https://leetcode.com/problems/unique-morse-code-words/ 문제 International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: 'a' maps to ".-", 'b' maps to "-...", 'c' maps to "-.-.", and so on. For convenience, the full table for the 26 letters of the English alphabet is given below: [".-","-...","-.-.","-..",".","..-.","--.","......