반응형

PROGRAMING/C# 8

[Algorithm] Reverse each word

Question :Convert input strint to new string with each word reversed.No punctuation in the string, each word separated by spaces.Casing should remain the same. 주어진 문장을 각각 거꾸로 해서 다시 출력하는 문제입니다. Solution : 이 문제를 풀기 위해서는 valildation과 normalization 그리고 search 알고리즘에 관한 지식이 필요합니다.먼저 입력값이 null거나 빈문자열인지를 확인한후 스페이스로 구분하여 배열에 저장하는 과정을 거칩니다.그런후 입력된 값을 거꾸로 반환 시켜 새로운 문자을 완성시킵니다.using System.Text;public class..

PROGRAMING/C# 05:14:16

[Algorithm] Valid Palindrome

Palindrome : 회문(回文) 또는 팰린드롬(palindrome)은 거꾸로 읽어도 제대로 읽는 것과 같은 문장이나 낱말, 숫자, 문자열(sequence of characters) 등입니다. Question :A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers. Given a string s, return true if it is a palindro..

PROGRAMING/C# 2024.04.30

[Algorithm] Palindrome Number

Palindrome : 회문(回文) 또는 팰린드롬(palindrome)은 거꾸로 읽어도 제대로 읽는 것과 같은 문장이나 낱말, 숫자, 문자열(sequence of characters) 등입니다. Question:Given an integer x, return true if x is a palindrome, and false otherwise. Example 1: Input: x = 121 Output: true Explanation: 121 reads as 121 from left to right and from right to left.  Example 2: Input: x = -121 Output: false Explanation: From left to right, it reads -121. Fro..

PROGRAMING/C# 2024.04.27

[Algorithm] Integer to Roman

Question:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol       Value I             1 V             5 X             10 L             50 C             100 D             500 M             1000For example, 2 is written as II in Roman numeral, just two one's added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which..

PROGRAMING/C# 2024.04.25
반응형