CHAR는 고정 사이즈이다.
남는 공간은 공백으로 채우게 된다.
공백 채움 비교(blank-padded comparison semantics)를 사용한다.
예를 들어 CHAR(10) 인 데
‘test’라는 4자짜리 문자열을 insert 하게 되면
남는 공간은 6개의 공백으로 채우게 된다.
따라서 무조건 처음 선언된 10byte가 소요된다.
물론 값을 받아 올 때 이 공백은 자동으로 제거된다.
공백까지 읽고 싶다면 PAD_CHAR_TO_FULL_LENGTH 모드를 활성화하면 공백까지 다 읽어온다.
if ( 저장할 데이터 길이 < 선언된 컬럼 길이 )
-> 남는 공간은 스페이스로 채워지므로 공간의 낭비가 발생한다.
따라서 반드시 고정길이에 해당하는 데이터만 CHAR로 선언하는 것이 좋다.
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.
Given a characters array tasks, representing the tasks a CPU needs to do, where each letter represents a different task. Tasks could be done in any order. Each task is done in one unit of time. For each unit of time, the CPU could complete either one task or just be idle.
However, there is a non-negative integer n that represents the cooldown period between two same tasks (the same letter in the array), that is that there must be at least n units of time between any two same tasks.
Return the least number of units of times that the CPU will take to finish all the given tasks.
A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker.
Given an encoded string, return its decoded string.
The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer.
You may assume that the input string is always valid; No extra white spaces, square brackets are well-formed, etc.
Furthermore, you may assume that the original data does not contain any digits and that digits are only for those repeat numbers, k. For example, there won't be input like 3a or 2[4].