string match

A collection of 5 post

String Compression

Problem Write a program that compresses a character string by inputting a character string consisting of uppercase letters and writing the number of repetitions to the right of the repeated character when the same character is repeated continuously.
However, if the number of repetitions is…

Shortest Distance Between Strings

Problem Given a string s and a letter t, write a program that prints the minimum distance each letter of string is from the letter . input The first line is given the string and the letter . Strings and characters are given only in lower case. The length of the string does not exceed 100. output…

Extract Numbers

Problem Given a string with a mixture of letters and numbers, only the numbers are extracted and a natural number is created in that order. If you extract only numbers from “tge0a1h205er”, it is 0, 1, 2, 0, 5, and if you make a natural number from this, it becomes 1205. The natural number produced…

Valid Palindrome

Problem A string that is the same whether read from the front or from the back is called a palindrome. Write a program that outputs “YES” if a string is input and “NO” if it is a palindrome. However, when examining palindromes, only alphabets are used to check palindromes, and case is not sensitive…

Palindrome String

Problem A string that is the same when read from the front or read from the back is called a palindrome. When a string is input, write a program that outputs “YES” if the string is a palindrome string, and “NO” if it is not a palindrome string. However, it is not case sensitive when checking…