본문 바로가기

카테고리

(314)
라즈베리파이5 xrdp 원격 접속 시 웹 브라우저 깨짐 현상 해결 방법 라즈베리파이5에서 rasberry Pi OS(Raspbian)에서 루트 계정 즉 설치 시 처음 만든 계정으로 xrdp를 이용해서 접속 시 생기는 문제점인데 바로 파이어폭스와 크로미움 두 브라우저 모두 화면이 깨져서 나오는데 간단한 해결방법이 있다. $ sudo adduser "새로운 유저명" 위 명령어를 통해서 새로운 유저를 생성한다. 그리고 해당 유저의 password 기입 후 나머지 내용은 입력하지 않고 Enter를 눌러도 상관없다. 그리고 원격으로 다시 접속 시 새로 추가한 유저를 사용하면 웹 브라우저는 문제없이 동작된다. 그런데 새로 추가된 사용자 계정을 통해서 sudo 명령어를 사용하지 못하는데 sudoers 파일에 sudo 명령에 대한 설정이 존재하는데 해당 내용에 추가해야 한다. $ su "..
백준 알고리즘 - 12891번: DNA 비밀번호 [Java] 문제: https://www.acmicpc.net/problem/12891 12891번: DNA 비밀번호 평소에 문자열을 가지고 노는 것을 좋아하는 민호는 DNA 문자열을 알게 되었다. DNA 문자열은 모든 문자열에 등장하는 문자가 {‘A’, ‘C’, ‘G’, ‘T’} 인 문자열을 말한다. 예를 들어 “ACKA” www.acmicpc.net 1. 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { static int answer; static String[] DNA = {"A", "C", "G", "T"}; publ..
LeetCode 42 Trapping Rain Water Hard [Java] 문제: https://leetcode.com/problems/trapping-rain-water/ Trapping Rain Water - LeetCode Can you solve this real interview question? Trapping Rain Water - Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Example 1: [https://assets.leetcode.com/upl leetcode.com 1. 코드 class Solution { public int trap(int[] ..
LeetCode 1 Two Sum Easy [Java] 문제: https://leetcode.com/problems/two-sum/ Two Sum - LeetCode Can you solve this real interview question? Two Sum - Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not leetcode.com 1. 코드 class Solution { public int[] twoSum(int[] nums, int target) ..
LeetCode 5 Longest Palindromic Substring Medium [Java] 문제: https://leetcode.com/problems/longest-palindromic-substring/ = 0 && r < s.length() && s.charAt(l) == s.charAt(r)) { l--; r++; } if(len < r - l - 1) { left = l + 1; len = r - l - 1; } } public String longestPalindrome(String s) { if(s.length() == 1) return s; for(int i = 0; i < s.length() - 1; i++) { sol(s, i, i + 1); sol(s, i, i + 2); } return s.substring(left, left + len); } } 양 끝의 문자가 동일하면..
LeetCode 49 Group Anagrams Medium [Java] 문제: https://leetcode.com/problems/group-anagrams/ Group Anagrams - LeetCode Can you solve this real interview question? Group Anagrams - Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase leetcode.com 1. 코드 class Solution { public List groupAnagrams(Str..
LeetCode 819 Most Common Word Easy [Java] 문제: https://leetcode.com/problems/most-common-word Most Common Word - LeetCode Can you solve this real interview question? Most Common Word - Given a string paragraph and a string array of the banned words banned, return the most frequent word that is not banned. It is guaranteed there is at least one word that is not banned, and tha leetcode.com 1. 코드 class Solution { public String mostCommonWo..
LeetCode 937 Reorder Data in Log File Medium [Java] 문제: https://leetcode.com/problems/reorder-data-in-log-files/ Reorder Data in Log Files - LeetCode Can you solve this real interview question? Reorder Data in Log Files - You are given an array of logs. Each log is a space-delimited string of words, where the first word is the identifier. There are two types of logs: * Letter-logs: All words (except the leetcode.com 1. 코드 class Solution { public ..