Category

coding-interview

72 posts

Leetcode Solution - Best Time to Buy and Sell Stock

Leetcode Solution - Best Time to Buy and Sell Stock

Problem Statement You are given an array prices where prices[i] is the price of…

System Design Interview Vocabulary Notes

System Design Interview Vocabulary Notes

In this post, we will see some of the frequently used concepts/vocabulary in…

Coding Interview - Facebook System Design Interview Types

Coding Interview - Facebook System Design Interview Types

System design interview is pretty common these days, specially if you are having…

Find the maximum sum of any continuous subarray of size K

Find the maximum sum of any continuous subarray of size K

Introduction You are given an array of integers with size N, and a number K…

Graph Topological Sorting - Build System Order Example

Graph Topological Sorting - Build System Order Example

Graph Topological Sorting This is a well known problem in graph world…

Binary Tree - Level Order Traversal

Binary Tree - Level Order Traversal

Problem Statement Given a Binary tree, print out nodes in level order traversal…

Four Sum - Leet Code Solution

Four Sum - Leet Code Solution

Problem Statement Given an array nums of n integers and an integer target, are…

Leetcode - Rearrange Spaces Between Words

Leetcode - Rearrange Spaces Between Words

Problem Statement You are given a string text of words that are placed among…

Leetcode - Maximum Non Negative Product in a Matrix

Leetcode - Maximum Non Negative Product in a Matrix

Problem Statement You are given a rows x cols matrix grid. Initially, you are…

Leetcode - Split a String Into the Max Number of Unique Substrings

Leetcode - Split a String Into the Max Number of Unique Substrings

Problem Statement Given a string s, return the maximum number of unique…

Crawler Log Folder - minimum number of operations needed to go back to the main folder after the change folder operations.

Crawler Log Folder - minimum number of operations needed to go back to the main folder after the change folder operations.

Problem The Leetcode file system keeps a log each time some user performs a…

Replace all spaces in a string with %20

Replace all spaces in a string with %20

Problem Statement Replace all spaces in a string with ‘%20’ (three characters…

Determine if a string has all unique characters

Determine if a string has all unique characters

Problem Implement an algorithm to determine if a string has all the characters…

Valid Palindrome - Leet Code Solution

Valid Palindrome - Leet Code Solution

Problem Statement Given a string, determine if it is a palindrome, considering…

Valid Anagrams - Leet Code Solution

Valid Anagrams - Leet Code Solution

Problem Statement Given two strings s and t , write a function to determine if t…

First Unique Character in a String - Leet Code Solution

First Unique Character in a String - Leet Code Solution

Problem Statement Given a string, find the first non-repeating character in it…

Reverse String - Leet Code Solution

Reverse String - Leet Code Solution

Problem Statement Write a function that reverses a string. The input string is…

Rotate Image - Leet Code Solution

Rotate Image - Leet Code Solution

Problem Statement You are given an n x n 2D matrix representing an image, rotate…

Validate Sudoku - Leet Code Solution

Validate Sudoku - Leet Code Solution

Problem Statement Determine if a 9x9 Sudoku board is valid. Only the filled…

Plus One - Leet Code Solution

Plus One - Leet Code Solution

Problem Statement Given a non-empty array of digits representing a non-negative…

Move Zeroes - Leet Code Solution

Move Zeroes - Leet Code Solution

Problem Statement Given an array nums, write a function to move all 0’s to the…