본문 바로가기

Algorithm/Code Fights (Code Signal)

(68)
Aracade Intro #28 alphabeticShift. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #28 alphabeticShift. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Given a string, replace each its character by the next one in the English alphabet (z would be replaced by a). (Lowercase alphabet only) 주어진 문자열에서, 각 알파벳을 그 다음 알파벳으로 바꾸어라 ( a->b, c->d ) z 의 경우에는 다시 a 로 돌아간다. (전부 소문자 알파벳) e.g. Input -> inputString = "crazy" Output -> alphab..
Aracade Intro #27 variableName. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #27 variableName. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Correct variable names consist only of English letters, digits and underscores and they can't start with a digit. Check if the given string is a correct variable name. 변수명으로 옳은 것은 알파벳, 숫자, 언더바로만 이루어져 있고, 시작은 숫자로 할 수 없다.옳은 변수명인지 확인하라. e.g. For name = "var_1__Int", the output s..
Aracade Intro #26 evenDigitsOnly. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #26 evenDigitsOnly. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Check if all digits of the given integer are even. 모든 자릿수 숫자가 짝수인지 확인하라 e.g. Input -> n = 248622 Output -> evenDigitsOnly(n) = true Input -> n = 642386 Output -> evenDigitsOnly(n) = false //처리과정//1. 정수를 입력받는다.//2. 정수의 자릿수 시작부터 끝까지 반복한다.// 2.1. 숫자가 짝수인지 확인한다.//3. 결과를 리턴한다. /..
Aracade Intro #25 arrayReplace. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #25 arrayReplace. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Given an array of integers, replace all the occurrences of elemToReplace with substitutionElem. 주어진 정수배열에서, elemToReplace 에 해당하는 정수를, substitutionElem 정수로 전부 바꿔라. Example Input -> inputArray = [1, 2, 1], elemToReplace = 1, and substitutionElem = 3 Output -> arrayReplace(input..
Aracade Intro #24 minesweeper. Algorithm, 알고리즘, Codefights, CodeSignal, regx, 정규표현식, 코드파이트, 코드시그널, c++ java c# scalar Aracade Intro #24 minesweeper. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar Q. In the popular Minesweeper game you have a board with some mines and those cells that don't contain a mine have a number in it that indicates the total number of mines in the neighboring cells. Starting off with some arrangement of mines we want to create a Minesweeper game setup. 지뢰찾기 게임에..
Aracade Intro #23 boxBlur. Algorithm, 알고리즘, Codefights, CodeSignal, regx, 정규표현식, 코드파이트, 코드시그널, c++ java c# scalar Aracade Intro #23 boxBlur. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar Q. Last night you partied a little too hard. Now there's a black and white photo of you that's about to go viral! You can't let this ruin your reputation, so you want to apply the box blur algorithm to the photo to hide its content. The pixels in the input image are represented as integers. The a..
Aracade Intro #22 avoidObstacles. Algorithm, 알고리즘, Codefights, CodeSignal, regx, 정규표현식, 코드파이트, 코드시그널, c++ java c# scalar Aracade Intro #22 avoidObstacles. Algorithm, Codefights, CodeSignal, regx, 정규표현식, 코드파이트, 코드시그널, c++ java c# scalar Q. You are given an array of integers representing coordinates of obstacles situated on a straight line. Assume that you are jumping from the point with coordinate 0 to the right. You are allowed only to make jumps of the same length represented by some integer. Find the minimal len..
Aracade Intro #21 isIPv4Address. Algorithm, 알고리즘, Codefights, CodeSignal, regx, 정규표현식, 코드파이트, 코드시그널, c++ java c# scalar Aracade Intro #21 isIPv4Address. Algorithm, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar Q. An IP address is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication. There are two versions of the Internet protocol, and thus two versions of addresses. One of them is the IPv4 address. IP주소..