본문 바로가기

LeetCode10

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.
125. Valid Palindrome 문제 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 palindrome, or false otherwise. 모든 대문자를 소문자로 변환하고 영숫자가 아닌 문자를 모두 제거한 후 앞뒤로 동일하게 읽는 경우 구는 회문입니다. 영숫자 문자에는 문자와 숫자가 포함됩니다. 문자열 s가 .. 2022. 7. 10.