hackerrank 3

Repeated String

L : https://www.hackerrank.com/challenges/repeated-string/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=warmup Q : 주어진 숫자까지 주어진 문자를 반복하여 a가 몇개인지 보는 문제. A : 나눠서 계산. 1234567891011121314151617181920212223242526272829Program repeatedString;var sVal : String; iVal, iCnt, iFcnt, ii, iMod, iModcnt : int64;begin Readln(sVal); Readln(iVal); iCnt := 0; iFcnt := ..

Jumping on the Clouds

L : https://www.hackerrank.com/challenges/jumping-on-the-clouds/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=warmup Q : 1을 피해서 점프를 몇 번하는가 ?.. A : 0인지 1인지 구분해서 값을 증가해서 처리 1234567891011121314151617181920212223program jumpingOnClouds;var iLen, ii, iVal, iZero, iResult : Longint;begin Readln(iLen); iZero := 0; iResult := 0; for ii := 0 to iLen - 1 do begi..

Sock Merchant

L : https://www.hackerrank.com/challenges/sock-merchant/problem Q : 짝수개인 숫자를 2개 단위로 묶기 A : 코딜리티에서 배웠던 xor연산으로 처리 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 program sockMerchant; uses Classes, SysUtils; var ia, ii, iResult : Integer; arr : array of integer; TList : TStringList; sVal : String; begin Readln(ia); SetLength(arr,ia); iResult := 0; TList := TStringList.Create;..