Url: https://leetcode.com/problems/largest-rectangle-in-histogram Question: Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the histogram. Above is a histogram where width of each bar is 1, given height = [2,1,5,6,2,3]. The largest rectangle is shown in the ...
-
2017년 11월 28일 -
2017년 11월 28일 [LeetCode] Merge 2 Sorted LinkedList
Url: https://leetcode.com/problems/merge-two-sorted-lists Question: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 솔직히 너무 쉬운 문제라 안올릴까 했는데 그냥 정리차원에서.. 사이즈를 알 필요도 없고, 단순히 두 개의 리스트 돌면서 그때마다 크기 비교해서 작은 ...