TwoSum

this problem requires that the sum be equal to the target value for  a given array. i used a hashmap. and when the target value is 6, the 0th index is 3 and the 1st index 3, a stream is used to distinguish the index.

 

Merge Two Sorted Lists

this problem is given by two sorted linked lists and two linked lists as one sorted linked list, which can be solved through three while statements. By comparing the values of each other, a smaller value can be configured as a new linkedlist

 

Number of Islands

this problem represents the shape of the island and the sea using a given two-dimenstional array. i was able to solve the problem with the dfs recursive algorithm.

 

Add Two Numbers

given two linked lists. i was able to solve the problem with time complexity O(n) by finding the sum through the while statement and deciding whether to round up.

 

Best Time to Buy and Sell Stock

to buy stocks on specific dates and sell them on specific dates. Time complexity can also be solved with O(n). Set the value of buying stocks for the smallest amount each day, For each day, set the price to sell the stock at the largest amount.

 

Minimum Path Sum

Due to the dp problem, we have to start at the top left and arrive at the bottom right. At the time of arrival, you shoud find the sum of the smallest values, which can be solved through the deduction method.

 

Longest Substring Without Repeating Characters

I solved this problem before. The problem was solved using maps and queue. the map was used to check whether a particular character was included in the current substring, and the queue was used to contain the current substring charachters in order.

 

Here, if a specific character exists in the map, the characters in the queue are squentially subtracted and the problem is also removed from the map. When specific character is dequeued, the character is newly put into the queue again. put on the map, and the substring is newly formed.

 

Symmetric Tree

the question should return whether the left and right subtrees are symmetrial in relation to given root. basically, in order to explore the tree, the structure should be made in recursive form, and the left and right values should be checked for symmetry based on the left and right subtrees.

 

like below forms,

(left.right == right.left) && (left.left == right.right)

 

====

[ 수정 2020-09-13 ]

해당 영문으로 작성되는 내용은 개인 깃헙의 레포로 대신하게 되었다.

'Problem Solving & Algorithm > LeetCode' 카테고리의 다른 글

20180309 Merge Two Sorted Lists  (0) 2018.03.09
20180306 Valid Parentheses  (0) 2018.03.06
20180304 Count And Say  (0) 2018.03.04
20180303 Two Sum  (0) 2018.03.03
Posted by doubler
,