250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 27 | 28 | 29 |
30 |
Tags
- Hp바
- Ainimation Blending
- 유니티
- joystick
- apk
- 플레이어 방향전환
- Unity
- 패럴렉스
- raycasting
- rigidbody
- Scrooling
- Hpbar
- raycast
- Object Poling
- Blend Type
- Animation State Machine
- 오브젝트 풀링
- Transform
- Vector3
- 프리팹
- 스크롤링
- 플레이어 이동
- 2D슈팅게임
- Object Pooling
- rotation
- Parallax
- CSharp #자료구조
- 일시정지
- Prefabs
- LayerMark
Archives
- Today
- Total
주녘공부일지
[프로그래머스 C#] Lv.2 최댓값과 최솟값 본문
728x90
https://school.programmers.co.kr/learn/courses/30/lessons/12939
1. 정답코드 및 핵심 아이디어, 유의사항
직관적인 문제로 주석참조
using System;
using System.Collections.Generic;
using System.Linq;
public class Solution
{
public string solution(string s)
{
// 공백을 기준으로 문자열을 잘라서 담음 (string[])
var strs = s.Split(' ');
var list = new List<int>();
// 리스트에 담음
foreach (string str in strs)
list.Add(int.Parse(str));
// 양식에 맞춰서 리턴
return $"{list.Min()} {list.Max()}";
}
}
728x90
'Programmers - C# > CodingTest Lv.2' 카테고리의 다른 글
[프로그래머스 C#] Lv.2 점 찍기 (1) | 2023.12.06 |
---|---|
[프로그래머스 C#] Lv.2 행렬의 곱셈 (1) | 2023.12.05 |
[프로그래머스 C#] Lv.2 다음 큰 숫자 (1) | 2023.12.05 |
[프로그래머스 C#] Lv.2 JadenCase 문자열 만들기 (1) | 2023.12.05 |
[프로그래머스 C#] Lv.2 N개의 최소공배수 (2) | 2023.12.05 |