# Coding Interviews ## Leetcode 895: Maximum Frequency Stack

CATEGORY: HARD Problem Design a stack-like data structure to push elements to the stack and pop the most frequent element from the stack. Implement the FreqStack class: Examples First Example : Constraints: Solution Approach Solution Logic In this problem of Maximum Frequency Stack, the main task is to find the frequency of the value in the stack. … ## Leetcode 31: Next Permutation

CATEGORY: MEDIUM Problem A permutation of an array of integers is an arrangement of its members into a sequence or linear order. The next permutation of an array of integers is the next lexicographically greater permutation of its integer. More formally, if all the permutations of the array are sorted in one container according to their lexicographical order, then … ## Leetcode 895: Maximum Frequency Stack

CATEGORY: HARD Problem Design a stack-like data structure to push elements to the stack and pop the most frequent element from the stack. Implement the FreqStack class: Examples Example 1: Constraints: Solution Approach In this problem of Maximum Frequency Stack, the main task is to find the frequency of the value in the stack. So, to find … ## Leetcode 6: Zigzag Conversion

CATEGORY: MEDIUM Problem The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)

And then read line by line: “PAYPALISHIRING” Write the code that will take a string and make this conversion given a number … ## Project Euler 12: Highly divisible triangular number

Highly divisible triangular number The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, … Let … ## Leetcode 62: Unique Paths

Category: Medium Problem A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked ‘Finish’ in the diagram below). How many … ## Project Euler 9: Special Pythagorean triplet

Problem A Pythagorean triplet is a set of three natural numbers, a < b < c , for which,a2 + b2 = c2 For example, 32 + 42 = 9 + 16 = 25 = 52. There exists exactly one Pythagorean triplet for which a+b+c = 1000.Find the product abc. Official Problem Solution Approach In this problem of Special Pythagorean triplet, we … ## Project Euler 10: Summation of primes

Summation of primes The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. Official Problem Solution Approach In this problem of Summation of primes till 1 million, we are supposed to find the sum of all the prime … ## Project Euler 8: Largest product in a series

Problem The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What is the value of this product? Official Problem Solution Approach In this problem of the Largest …