본문 바로가기

Algorithm/String

(134)
(C++) - LeetCode (easy) 824. Goat Latin https://leetcode.com/problems/goat-latin/description/ Goat Latin - LeetCode Can you solve this real interview question? Goat Latin - You are given a string sentence that consist of words separated by spaces. Each word consists of lowercase and uppercase letters only. We would like to convert the sentence to "Goat Latin" (a made-up leetcode.com 문자열 다루는 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. 공백 문자 ' '를 구분자로..
(C++) - LeetCode (easy) 819. Most Common Word https://leetcode.com/problems/most-common-word/description/ Most Common Word - LeetCode Can you solve this real interview question? Most Common Word - Given a string paragraph and a string array of the banned words banned, return the most frequent word that is not banned. It is guaranteed there is at least one word that is not banned, and tha leetcode.com 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 단어와 빈도수를 저장..
(C++) - LeetCode (easy) 557. Reverse Words in a String III https://leetcode.com/problems/reverse-words-in-a-string-iii/description/
(C++) - LeetCode (easy) 541. Reverse String II https://leetcode.com/problems/reverse-string-ii/description/ Reverse String II - LeetCode Can you solve this real interview question? Reverse String II - Given a string s and an integer k, reverse the first k characters for every 2k characters counting from the start of the string. If there are fewer than k characters left, reverse all of them. leetcode.com 문자열을 다루는 문제였습니다. 📕 풀이방법 📔 풀이과정 2*k만큼 증..
(C++) - LeetCode (easy) 521. Longest Uncommon Subsequence I https://leetcode.com/problems/longest-uncommon-subsequence-i/description/ Longest Uncommon Subsequence I - LeetCode Can you solve this real interview question? Longest Uncommon Subsequence I - Given two strings a and b, return the length of the longest uncommon subsequence between a and b. If the longest uncommon subsequence does not exist, return -1. An uncommon subseq leetcode.com 문자열 문제였습니다. ..
(C++) - LeetCode (easy) 482. License Key Formatting https://leetcode.com/problems/license-key-formatting/description/ License Key Formatting - LeetCode Can you solve this real interview question? License Key Formatting - You are given a license key represented as a string s that consists of only alphanumeric characters and dashes. The string is separated into n + 1 groups by n dashes. You are also given a leetcode.com 문자열 재구성 문제였습니다. 📕 풀이방법 📔 입력 ..
(C++) - LeetCode (easy) 459. Repeated Substring Pattern https://leetcode.com/problems/repeated-substring-pattern/description/ Repeated Substring Pattern - LeetCode Can you solve this real interview question? Repeated Substring Pattern - Given a string s, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. Example 1: Input: s = "abab" Output: true Expl leetcode.com 문자열을 다루는 문제였습니다. 📕 풀이방법..
(C++) - LeetCode (easy) 434. Number of Segments in a String https://leetcode.com/problems/number-of-segments-in-a-string/description/