링크 : https://www.hackerrank.com/challenges/cats-and-a-mouse/problem 문제>x(A), y(B)는 고양이z(C)는 쥐쥐(z)가 고양이 x, y 곁에 있으면 잡힌다.x, y 사이에 있으면 고양이끼리 싸우느라 쥐(z)가 도망가서 쥐의 승리. Cat A Cat BMouse C 승리 순서로 출력하는 문제. 해결방법. using System.CodeDom.Compiler; using System.Collections.Generic; using System.Collections; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using Sys..
링크 : https://www.hackerrank.com/challenges/cut-the-sticks/problem 문제>가장 짧은 막대로 잘라나가다가 막대가 남지 않아을 때까지 컷팅되는 수를 구할 것. 해결방법.받아온 스틱길이(arr배열)을 리스트화해서 남은 수가 0이 될 떄까지 반복하는 while를 돌려준다.잘라나갈 사이즈를 스틱리스트에서 가장 작은 수로 계속 교체해나가면서 값을 감소시켜 0이 된 값은 지워버린다.감소 시킬때마다 카운트를 증가시켜준다. using System.CodeDom.Compiler; using System.Collections.Generic; using System.Collections; using System.ComponentModel; using System.Diagnos..
링크 : https://www.hackerrank.com/challenges/kangaroo/problem 문제>캥거루 x랑 캥거루 v가 뛴다.v가 x를 따라잡을 수 있는지 구하라. * 조건 캥거루 x는 자신의 시작 위치 이상의 범위만큼 점프한다. 해결방법. using System.CodeDom.Compiler; using System.Collections.Generic; using System.Collections; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using..
링크 : https://www.hackerrank.com/challenges/breaking-best-and-worst-records/problem 문제>이전 값 보다 커지는 수, 이전 값 보다 작아지는 수를 각각 구해서 각 카운트를 출력하는 문제. 해결방법. using System.CodeDom.Compiler; using System.Collections.Generic; using System.Collections; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; usin..
링크 : https://www.hackerrank.com/challenges/mars-exploration/problem 문제> 입력받은 텍스트는 반복적인 순서로 SOS가 되어야 한다.SOS의 순서가 아닌 문자의 를 찾을 것.ex ) SOSSOT = 1SOSSOSSRTSOS = 2 해결방법.문자마다 3으로 나눈 나머지로 나머지가 0일때 S, 1일때O 2일때 S를 비교했다. using System.CodeDom.Compiler; using System.Collections.Generic; using System.Collections; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; u..