목록분류 전체보기 (960)
넘치게 채우기
https://leetcode.com/problems/valid-sudoku/description/?envType=study-plan-v2&envId=top-interview-150 Valid Sudoku - LeetCode Can you solve this real interview question? Valid Sudoku - Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: 1. Each row must contain the digits 1-9 without repetition. 2. Each c leetcode.com 문제 유형 : 2..
https://leetcode.com/problems/valid-anagram/description/?envType=study-plan-v2&envId=top-interview-150 Valid Anagram - LeetCode Can you solve this real interview question? Valid Anagram - 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 leetcode.com ..
입출력 팁 import java.io.*; public class FastIOExample { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out)); // 문자열로 읽고 출력하기 String inputLine = reader.readLine(); writer.write("입력 받은 문자열: " + inputLine); // 숫자로 읽고 출력하기 int num = Integer..
https://leetcode.com/problems/interleaving-string/description/ Interleaving String - LeetCode Can you solve this real interview question? Interleaving String - Given strings s1, s2, and s3, find whether s3 is formed by an interleaving of s1 and s2. An interleaving of two strings s and t is a configuration where s and t are divided into n and m subs leetcode.com 문제 유형 : 문자열 처리 / 동적 계획법 문제 난이도 : M..
입출력 import sys sys.stdin.readline() # 한줄 전체 입력받기. input()보다 빠르게 입력받을 수 있다. 개행문자 \n도 딸려오니 주의. a, b, c = map(int, sys.stdin.readline().split()) # a, b, c에 각각 넣기 형변환 int(x) # int로 변환 str(x) # 문자열로 변환 float(x) # 실수 타입 변환 chr(x) # 문자로 변환 bool(x) # 참/거짓값으며 변환(0이나 null이 아닌경우 모두 True) 수학 1e9 = 10^9 2e9 = 2 * 1e9 (INT_MAX에 거의 근접한 값이다) 1e9 + 7 # 보통 온라인 저지 사이트나 알고리즘 대회에서 값이 너무 커질 때, 오버플로우를 막기 위해서 1e9 + 7로 ..
https://leetcode.com/problems/longest-substring-without-repeating-characters/description/?envType=study-plan-v2&envId=top-interview-150 int: n = len(s) maxLen = 0 left = 0 charSet = set() for right in range(n): while s[right] in charSet: charSet.remove(s[left]) left += 1 charSet.add(s[right]) maxLen = max(maxLen, right - left + 1) return maxLen Java class Solution { public int lengthOfLongestSub..
https://leetcode.com/problems/excel-sheet-column-title/description/ Excel Sheet Column Title - LeetCode Can you solve this real interview question? Excel Sheet Column Title - Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 ... Example 1: I leetcode.com 문제 유형 : 문자열 처리 문제 난이도 : Eas..
https://leetcode.com/problems/repeated-substring-pattern/ 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 문제 유형 : 문자열 처리 문제 난이도 : Easy 문제 Giv..
https://leetcode.com/problems/minimum-size-subarray-sum/description/?envType=study-plan-v2&envId=top-interview-150 Minimum Size Subarray Sum - LeetCode Can you solve this real interview question? Minimum Size Subarray Sum - Given an array of positive integers nums and a positive integer target, return the minimal length of a subarray whose sum is greater than or equal to target. If there is no s..
https://leetcode.com/problems/3sum/description/?envType=study-plan-v2&envId=top-interview-150 3Sum - LeetCode Can you solve this real interview question? 3Sum - Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the solution set must not contain du leetcode.com 문제 유형 : 투 포인터 문제 난..