Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked list if there is some node in…
My memo and playground
Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked list if there is some node in…
Given a string s representing a valid expression, implement a basic calculator to evaluate it, and return the result of the evaluation.…
Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0‘s. You must do it in …
You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate t…
Given an m x n matrix, return all elements of the matrix in spiral order. Example 1: Input: matrix = [[1,2,3],[4,5,6],[7,8,9]…
Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: Note…
You are given an array of strings tokens that represents an arithmetic expression in a Reverse Polish Notation. Evaluate the expression…
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Implement the MinStack class: You must imp…
Given a string path, which is an absolute path (starting with a slash ‘/’) to a file or directory in a Unix-style file system, con…
Given a string s containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input s…