The Blind 75 Coding Questions, a collection of helpful coding challenges to improve my coding skills.
Inspired by this blog post
1. Two Sum
2. Longest Substring Without Repeating Characters
6. Remove Nth Node From End of List
7. Valid Parentheses
8. Merge Two Sorted Lists
26. Same Tree
28. Maximum Depth of Binary Tree
30. Best Time to Buy and Sell Stock
40. Reverse Bits
44. Reverse Linked List
50. Contains Duplicate
51. Invert Binary Tree
55. Product of Array Except Self
60. Missing Number
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order.
Given a string s, find the length of the longest substring without repeating characters.
Given the head of a linked list, remove the nth node from the end of the list and return its head.
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
An input string is valid if:
- Open brackets must be closed by the same type of brackets.
- Open brackets must be closed in the correct order.
- Every close bracket has a corresponding open bracket of the same type.
You are given the heads of two sorted linked lists list1 and list2. Merge the two lists in a one sorted list. The list should be made by splicing together the nodes of the first two lists. Return the head of the merged linked list.
Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.
Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock. Return the maximum profit you can achieve from this transaction. If you cannot achieve any profit, return 0.
Reverse bits of a given 32 bits unsigned integer.
Given the head of a singly linked list, reverse the list, and return the reversed list.
Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
Given the root of a binary tree, invert the tree, and return its root.
Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer. You must write an algorithm that runs in O(n) time and without using the division operation.
Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.