본문 바로가기
반응형

분류 전체보기505

Unity - Bounds 속성 2D기준 설명 Bounds 주로 객체의 경계 영역을 나타내는데 사용된다. Bounds bounds = collider2D.bounds; 01 center Bounds의 중심 위치는 collider2d의 중심 위치이다. Debug.Log($"Center: + {bounds.center.x} , {bounds.center.y}, {bounds.center.z}"); 02 extents collider2D의 크기 절반(extents)이다. Debug.Log($"Extents: + {bounds.extents.x} , {bounds.extents.y}, {bounds.extents.z}"); 03 min & max bounding box의 최소지점 꼭짓점과 최대지점 꼭짓점이다. Debug.Log($"Min: + {bounds.. 2023. 9. 9.
Privacy Policy Privacy Policy This Privacy Policy describes how we collect, use, and share personal information when you visit or interact with our website or app. We are committed to protecting your privacy and ensuring the security of your personal information. 1. Information We Collect We may collect the following types of personal and non-personal information when you use our website or app: Information co.. 2023. 9. 8.
프로그래머스 C# - 올바른 괄호 풀이 '(' ')'의 숫자들을 종이에 하나씩 적어보면 로직이 쉽게 보인다. public class Solution { public bool solution(string s) { bool answer = true; Stackstack = new Stack(); int right = 0; int left = 0; for(int i =0;i 2023. 9. 7.
프로그래머스 C# - 최솟값 만들기 풀이 이것저것 끄적이다가 A는 작은 순서대로 B는 큰 순서대로 앞에서 부터 곱하고 더하면 그 결과가 답인 것을 알게 되었다. 1. A와 B Sort 2. B Reverse 3. 앞에서부터 각각 곱하고 다 더하면 정답이 나온다. public class Solution { public int solution(int[] A, int[] B) { int answer = 0; Array.Sort(A); Array.Sort(B); Array.Reverse(B); for(int i=0;i 2023. 9. 6.
C# - DFS(깊이우선탐색)개념 및 코드 구현 깊이 우선 탐색(DFS, Depth-First Search) 특정 노드에서 시작하여 그래프를 탐색하면서 제일 깊은 곳으로 들어갔다가 더 이상 들어갈 곳이 없게 되면 다시 돌아와 다른 경로로 탐색을 진행한다. 이를 통해 모든 노드를 방문하고자 할때 사용할 수 있는 탐색 알고리즘이다. 1. 행렬 01 그래프 행렬로 표현 int[,] adj = new int[10, 10] { {0,1,0,0,0,0,0,1,0,0 }, {1,0,1,0,1,0,0,0,0,0 }, {0,1,0,1,0,0,0,0,0,0 }, {0,0,1,0,0,0,0,0,0,0 }, {0,1,0,0,0,1,1,1,0,0 }, {0,0,0,0,1,0,0,0,0,0 }, {0,0,0,0,1,0,0,0,0,0 }, {1,0,0,0,1,0,0,0,1,0 .. 2023. 9. 6.
프로그래머스 C# - JadenCase 문자열 만들기 첫 문자가 대문자이고 그 외의 알파벳은 소문자인 문자열 1) 문자열 소문자로 일단 만들기 2)그리고 첫번째 요소들만 대문자로 만들기 public class Solution { public string solution(string s) { string[] token = s.ToLower().Split(" "); string answer = ""; for(int i=0; i 공백 문자 삭제하기 public class Solution { public string solution(string s) { string[] token = s.ToLower().Split(" "); string answer = ""; for(int i=0; i 2023. 9. 5.
반응형