목록Computer (234)
Machineboy空

문제요약주어진 행렬에 대한 열과 행의 정보를 출력하라.난이도Medium풀이 포인트입력값 원하는 대로 변환 (string 값 => 정수의 2차원 배열로)2차원 배열 사용https://machineboy0.tistory.com/305 C# 컬렉션 - 배열, 다차원 배열 - rank, getLength, Array.IndexOf(), Array.Sort()컬렉션(Collection)이란?data structures that can hold zero or more elements are known as collections0개 혹은 더 많은 요소를 가질 수 있는 데이터 구조배열(Array) 이란 ? + 특징컬렉션 중 하나fixed size, elements must all be omachineboy0.tisto..

문제요약주어진 수를, span길이로 쪼개어 담고, 그 수의 곱 중 가장 큰 값을 반환하라. https://exercism.org/tracks/csharp/exercises/largest-series-product/edit ExercismLearn, practice and get world-class mentoring in over 50 languages. 100% free.exercism.org난이도Medium풀이 포인트LINQ사용연습AnySelectMaxSkip.TakeAggregateREVIEW 문제 자체는 쉬워서 Substring으로 금방 풀었으나, LINQ 연습하기 좋아보여서 기록.LINQ는 도무지 익숙해지지가 않는다.. CODEusing System;using System.Linq;public ..
문제요약3,5,7의 배수인지 살피고 조건에 맞는 문자를 출력하라! 난이도Easy풀이 포인트나는 Flag로 중복을 방지했다모범 풀이는 애초에 정해진 길이의 StringBuilder를 사용했다.REVIEW 이런 난이도가 쉬운 문제는 아이디어에 따라 꽤 코드가 달라진다.나는 Flag로 해당 조건이 이미 만족되었는지를 체크했다. 45줄은 된다.그런데 모범 풀이는 더욱 가독성 좋게 15줄로 해결했다..그래서 기록해둔다!CODEusing System.Globalization;using System.Text;public static class Raindrops{ public static string Convert(int number) { var drops = new StringBuilder(1..

문제요약주어진 key에 맞게 원본 문자열을 변형시킨 암호를 출력하라.난이도Medium풀이 포인트random 키 생성아스키 코드 활용문제 이해REVIEW 문제 이해를 한참 못했다.Step 2 그러니까 a: 0 , d:3 의 식으로 암호에 따른 shift가 어떻게 이루어진다는 것인지 이해하는 데 오래 걸렸다.그리고 순환되는 값에는 나머지를 잘 활용해야한다는 것! 또 명심. 뭔가 익숙해진듯, 계속 까먹는 아이디어들이 생긴다.CODEusing System;public class SimpleCipher{ private string key; // 기본 생성자 (랜덤 키 생성) public SimpleCipher() { Random rand = new Random(); ..

Circular Buffer란?생산자와 소비자 처리 사이의 통신에 버퍼를 제공하기 위해 일정량의 기억 장치를 할당한다.그 로직이 원형으로 형성되는 버퍼를 말한다.고정적인 크기: queue with a maximum size, constrained size or capacity, stores data in a fixed-size array원형으로 탐색: continue to loop back over itself in a circular motionCircular Buffer의 작동 방식두 개의 포인터(front, back)로 읽을 위치, 삭제할 위치, 쓸 위치 등을 정한다.storing two pointer to the front and back of the structure버퍼가 모두 차면 가장 오래된..
문제요약문자열로 이루어진 수식을 계산하여라. https://exercism.org/tracks/csharp/exercises/wordy Wordy in C# on ExercismCan you solve Wordy in C#? Improve your C# skills with support from our world-class team of mentors.exercism.org난이도Medium풀이 포인트문자열 다루기 : What is ~ ? 꼴의 문자열을 원하는 방식으로 자르기예외 처리수와 수 사이에 연산자가 없을 때 : minus 1 2이상한 문장이 들어왔을 때: what is your name?REVIEW 이런 문제는 차력으로 풀리기 때문에 또 차력으로 풀었다. 문자열이 숫자인지 판단하는 방법으로in..

문제요약괄호쌍이 제대로 닫히는 지 파악하라! https://exercism.org/tracks/csharp/exercises/matching-brackets Matching Brackets in C# on ExercismCan you solve Matching Brackets in C#? Improve your C# skills with support from our world-class team of mentors.exercism.org난이도Medium풀이 포인트key - value를 사용하든, 두 괄호쌍의 연결해둘 수 있는 자료구조 사용Stack 아이디어https://machineboy0.tistory.com/177 9012 : 괄호 - stack, 그리디 알고리즘, getline(cin,s)http..
문제요약틱택토 게임의 상태를 반환하라.WinDrawOngoingInvalid https://exercism.org/tracks/csharp/exercises/state-of-tic-tac-toe State of Tic-Tac-Toe in C# on ExercismCan you solve State of Tic-Tac-Toe in C#? Improve your C# skills with support from our world-class team of mentors.exercism.org난이도Medium풀이 포인트Invalid 조건 꼼꼼히 따져주기REVIEW Excercism의 허점을 발견했다.분명 완벽하지 않은 풀이인데 주어진 테스트 케이스들만 통과시켰더니 정답풀이라고 해주더라.3*3 칸 밖에 되지 않아..