Aracade Intro #17 ArrayChange, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar
Aracade Intro #17 ArrayChange, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar Q. You are given an array of integers. On each move you are allowed to increase exactly one of its element by one. Find the minimal number of moves required to obtain a strictly increasing sequence from the input. 정수 배열을 입력받고, 인덱스 순서로 따라올라가는데.. 한 행동에 한개의 숫자 1씩을 증가시킬수 있다. 전부 오름차순이 되도록 해야된다. 전부 오름차순이 되는데 움직인 개수..
Aracade Intro #16 AreSimilar?, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar
Aracade Intro #16 AreSimilar?, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar Q. Two arrays are called similar if one can be obtained from another by swapping at most one pair of elements in one of the arrays. Given two arrays a and b, check whether they are similar. 입력받은 두개의 배열 (a, b) 중에서, 어느 한개의 배열에서 한 쌍의 요소들 자리만 바꿔서 (위치는 서로 떨어져 있어도 상관없음) a, b 배열이 같아지면, 비슷하다는 것이 true 이다. e.g. Input -..