Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature. If there is no future day for which this is possible, keep answer[i] == 0 instead.
Java에서 클래스 변수 혹은 인스턴스 변수를 초기화하는 방법은 다양하다.
그 중 Static Initializer Block와 Instance Initializer Block의 동작 순서를 코드로 알아보자.
Given the root of a binary tree, invert the tree, and return its root.
How to automatically assign a reviewer?
Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the number of 1's in the binary representation of i.
It is very easy to come up with a solution with a runtime of O(n log n). Can you do it in linear time O(n) and possibly in a single pass?
You are given a string s.
We want to partition the string into as many parts as possible so that each letter appears in at most one part.
Return a list of integers representing the size of these parts.