KEVIN HSU

About being a great person, developer and friend.

Least Recently Used (LRU) cache

Leetcode - No. 146

146 LRU CacheDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the value (will always be positive) o......

Min Stack

Leetcode - No. 155

Min StackDesign a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) – Push element x onto stack. pop() – Removes the element on top of the stack. top......

Satisfiability of Equality Equations

Leetcode - No. 990

Satisfiability of Equality Equations990. Satisfiability of Equality Equations Given an array equations of strings that represent relationships between variables, each string equations[i] has length......

Word Ladder

Leetcode - No. 127

Word LadderWord Ladder Given two words (beginWord and endWord), and a dictionary’s word list, find the length of shortest transformation sequence from beginWord to endWord, such that: Only one lett......

Set Matrix Zeroes

Leetcode - No. 73

73 Set Matrix ZeroesGiven a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place. 1234567891011121314Example 1:Input: [ [1,1,1], [1,0,1], [1,1,1]]Output: [ [1,0,......

Merge k Sorted Lists

Leetcode - No. 23

23 Merge k Sorted ListsMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 123456789Example:Input:[ 1->4->5, 1->3->4, 2->6]Output: 1......

Letter Combinations of a Phone Number

Leetcode - No. 17

17 Letter Combinations of a Phone NumberGiven a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to letters (......

String to Integer

Leetcode - No. 8

8 String to IntegerThe function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes an optional in......