본문 바로가기

LeetCode16

242. Valid Anagram C++문제 풀이 242. Valid Anagram Easy 5643231Add to ListShare Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. 두 개의 문자열 s와 t가 주어지면 t가 s의 아나그램이면 true를 반환하고 그렇지 않으면 false를 반환합니다. Anagram은 일반적으로 모든 원래 문자를 정확히 한 번 사용하여 다른 단어 또는 구.. 2022. 7. 20.
387. First Unique Character in a String 문제풀이 387. First Unique Character in a String Easy 5340207Add to ListShare Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1. 단 한번만 쓰여진 문자형을 찾아 그 index를 retrun 하면 된다. Example 1: Input: s = "leetcode" Output: 0 Example 2: Input: s = "loveleetcode" Output: 2 Example 3: Input: s = "aabb" Output: -1 Constraints: 1 2022. 7. 19.
20. Valid Parentheses 문제풀이 20. Valid Parentheses Easy 14119658Add to ListShare Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. '(', '), '{', '}, '[' 및 ']] 문자만 포함하는 문자열이 주어지면 입력 문자열이 유효한지 확인하십시오. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. 다음과 같은 경우 입력 문자열이 .. 2022. 7. 13.
415. Add Strings 문제 c++ 415. Add Strings Easy 3455574Add to ListShare Given two non-negative integers, num1 and num2 represented as string, return the sum of num1 and num2 as a string. You must solve the problem without using any built-in library for handling large integers (such as BigInteger). You must also not convert the inputs to integers directly. 큰 정수(예: BigInteger)를 처리하기 위해 내장 라이브러리를 사용하지 않고 문제를 해결해야 합니다. 또한 입력.. 2022. 7. 10.