Binary Search

Binary SearchRegular Binary SearchBinary Search in a Rotated Sorted ArrayGit DiffWhy the Difference?Similar Problem Binary Search Regular Binary Search Key Idea: In a normal sorted array, you can directly compare…

Container With Most Water

Leetcode#11 Container With Most WaterProblem StatementGolang SolutionOutput Container With Most Water Problem Statement You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of…

Maximum Points You Can Obtain from Cards

Leetcode#1423 Maximum Points You Can Obtain from CardsLogicHint 1Hint 2Golang solutionOutputGit diff compare to max-sum-of-k-windowPrefix Sum solution for circular subArraySummary Maximum Points You Can Obtain from Cards There are several cards arranged in…

Max Sum of K Window

Max Sum of K WindowProblem StatementGolang SolutionOutputTest CasesPositive CaseNegative NumbersInvalid CasesSimilar Problem Max Sum of K Window Problem Statement Given an array and an integer K, return the maximum sum…

(TBD)Longest Consecutive Sequence

Leetcode#128 Longest Consecutive SequenceProblem StatementGolang Solution Longest Consecutive Sequence Problem Statement Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm…

HashMap HashTable

Interview Questions Interview Questions Implement a hash map from scratch with basic operations (get, put, delete). Find two numbers in an array that add up to a target value using…