C#/[프로그래머스] 카카오 문제(2)
-
C# 숫자 문자열과 영단어
using System; using System.Collections.Generic; public class Solution { public int solution(string s) { Dictionary num = new Dictionary(); num.Add("zero", 0); num.Add("one", 1); num.Add("two", 2); num.Add("three", 3); num.Add("four", 4); num.Add("five", 5); num.Add("six", 6); num.Add("seven", 7); num.Add("eight", 8); num.Add("nine", 9); string s2 = ""; foreach (var item in num) { s = s.Replace(i..
2022.03.22 -
C# 신고 결과 받기
코드 : using System; public class Solution { public static void Reset2(int[,] array) //초기화 { for (int i = 0; i < array.GetLength(0); i++) { for (int j = 0; j < array.GetLength(1); j++) { array[i, j] = 0; } } } public static void Reset(int[] array) //초기화 { for (int i = 0; i < array.Length; i++) { array[i] = 0; } } public int[] solution(string[] id_list, string[] report, int k) { int[] answer = new ..
2022.03.22