본문 바로가기

leetcode

(151)
Aracade Intro #45 buildPalindrome. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #45 buildPalindrome. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Given a string, find the shortest possible string which can be achieved by adding characters to the end of initial string to make it a palindrome. 주어진 문자열에서, 가장 적은수의 문자를 추가해서 회문 문자가 가능하게 되는 문자열를 찾아라. ( 회문 - 수박이박수 처럼 앞뒤로 읽어도 같은 것 ) e.g. Input -> st = "abcdc" Output -> build..
How to convert file to byte array (byte[]) example, 파일 객체 바이트로 변환하기 예제코드, java/cpp/c++/scalar How to convert file to byte array (byte[]) example, 파일 객체 바이트로 변환하기 예제코드, java/cpp/c++/scalar 파일 객체를 만들어주고, 파일객체의 path를 java.nio.file.Files 의 readAllBytes 함수에 넣어 사용한다. Make file object first, and use that file path in readAllBytes method in java.nio.file.Files Example code...예제코드 byte[] array = Files.readAllBytes(new File("file/path.txt").toPath()); Something else you might like..? 2018/12/18 - ..
Aracade Intro #44 findEmailDomain. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #44 findEmailDomain. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. An email address such as "John.Smith@example.com" is made up of a local part ("John.Smith"), an "@" symbol, then a domain part ("example.com"). The domain name part of an email address may only consist of letters, digits, hyphens and dots. The local part, however, also all..
How to access controller from existing Pane in JavaFX, pane에서 해당 controller로 접근하기, java/cpp/c++/fx/gui How to access controller from existing Pane in JavaFX, pane에서 해당 controller로 접근하기, java/cpp/c++/fx/gui Q. Pane에서 직접 해당 Controller를 뽑아낼 수 없다.Pane 에서 Scene을 통해 FxmlLoader를 뽑아내는 방법이 있고, 그 후 loader를 통해서Controller를 가져올 수 있다. 예제 코드를 보자 We cannot get Controller from Pane directly, so i struggled some. After bringing Scene, then we could get FxmlLoader from Scene. So it can get Controller. e.g. FXMLLoad..
Aracade Intro #43 isBeautifulString. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #43 isBeautifulString. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. A string is said to be beautiful if b occurs in it no more times than a; c occurs in it no more times than b; etc. Given a string, check whether it is beautiful. 아름다운 문자열은... b의 개수가 a보다 많지 않고, c의 개수가 b보다 많지 않고, 등등... 주어진 문자열이 아름다운지 확인해봐라 (a, b, c, 알파벳 순서가 다 채워져 있어야함, 앞의 ..
Aracade Intro #42 bishopAndPawn. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #42 bishopAndPawn. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Given the positions of a white bishop and a black pawn on the standard chess board, determine whether the bishop can capture the pawn in one move. The bishop has no restrictions in distance for each move, but is limited to diagonal movement. Check out the example below to se..
Aracade Intro #41 digitDegree. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #41 digitDegree. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Let's define digit degree of some positive integer as the number of times we need to replace this number with the sum of its digits until we get to a one digit number. Given an integer, find its digit degree. 양의 정수의 자릿수를 찾아보는데, 한자리 숫자가 나올 때까지 각 자리 수들의 합을 구하는 동작을 반복한다. 주어진 정수에서..
How to check ongoing live process on Linux cmd, 리눅스 커맨드창에서 어떤 프로세스가 실행중인지 확인하기, java, ubuntu, cpp How to check ongoing live process on Linux cmd, 리눅스 커맨드창에서 어떤 프로세스가 실행중인지 확인하기, java, ubuntu, cpp 리눅스 cmd 창에서 검색할 프로세스명을 grep 명령어를 써서 골라낸다. Check process name using "grep" command in linux cmd e.g. ps -ef | grep "java" ps -ef | grep "chromium" Something else you might like... 2018/12/13 - [Programming/Java] - How to change color theme in JavaFx example, 자바Fx 전체적인 색 테마 바꾸기 예제, ui, 디자인 2018/12/11 ..