# Coding Interviews ## Project Euler 5: Smallest Multiple

Problem 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? Official Problem Solution Approach In this problem of smallest multiple, we have to find the smallest … ## Leetcode 409: Longest Palindrome | Leetcode Easy

Category: Easy Problem Given a string s which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters. Letters are case sensitive, for example, “Aa” is not considered a palindrome here. Problem Link. Examples Example 1: Example 2: Constraints 1 <= s.length <= 2000 s consists of lowercase and/or uppercase English letters only. Solution Approach In this … ## Leetcode 1672: Richest Customer Wealth

Category: Easy Problem You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the i​​​​​​​​​​​th​​​​ customer has in the j​​​​​​​​​​​th​​​​ bank. Return the wealth that the richest customer has. A customer’s wealth is the amount of money they have in all their bank accounts. The richest customer is the customer that has the maximum wealth. Problem Link. Examples Example 1: Example 2: Constraints … ## Project Euler 4: Largest palindrome product

Problem A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two 3-digit numbers. Official Problem Solution Approach In this problem of the Largest palindrome product, we have to find the … ## Leetcode 136: Single Number

Category: Easy Problem Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. Follow up: Could you implement a solution with a linear runtime complexity and without using extra memory? Problem Link. Examples Example 1: Example 2: Constraints 1 <= nums.length <= 3 * 104 -3 * 104 <= nums[i] <= 3 * 104 … ## Leetcode 27: Remove Element

Category: Easy Problem Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. The order of elements can be changed. It doesn’t matter what you leave beyond the new length. https://leetcode.com/problems/remove-element Examples Example … ## Project Euler 3: Largest prime factor

Problem The prime factors of 13195 are 5, 7, 13, and 29. What is the largest prime factor of the number 600851475143 ? Official Problem Solution Approach In this problem, we are supposed to find the largest prime number which divides the given number. We will use a basic mathematics theorem called the “fundamental theorem … ## Leetcode 19: Remove Nth Node From End of List

Category: Medium Problem Given the head of a linked list, remove the nth node from the end of the list and return its head. Follow up: Could you do this in one pass? https://leetcode.com/problems/remove-nth-node-from-end-of-list Examples Example 1: Example 2: Example 3: Solution Approach In this problem of “remove nth node from the list”, we are given a linked list whose … ## Leetcode 66: Plus one

Category: Easy Problem Given a non-empty array of decimal digits representing a non-negative integer, increment one to the integer. The digits are stored such that the most significant digit is at the head of the list, and each element in the array contains a single digit. You may assume the integer does not contain any leading zero, except the … ## Project Euler 2: Even Fibonacci Numbers

Problem Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, … By considering the terms in the Fibonacci sequence whose values do not exceed four million, find …