Skip to content

Only Code

Eat Code Sleep – repeat

  • Github
  • Home
  • Arrays
  • Linked Lists
  • Trees
  • Stacks
  • Queues
  • Heaps
  • Graphs
  • Algorithms+
    • Sorting
    • Dynamic Programming
    • Divide and Conquer
    • Backtracking & Recursion
    • Greedy approach
    • Breadth First Search (BFS)
    • Depth First Search (DFS)

Only Code

Eat Code Sleep – repeat

Close menu
  • Github
  • Home
  • Arrays
  • Linked Lists
  • Trees
  • Stacks
  • Queues
  • Heaps
  • Graphs
  • Algorithms+
    • Sorting
    • Dynamic Programming
    • Divide and Conquer
    • Backtracking & Recursion
    • Greedy approach
    • Breadth First Search (BFS)
    • Depth First Search (DFS)

Only Code

Eat Code Sleep – repeat

Search Toggle menu

Category: Interview Questions

Restaurant Rating Solution (Heap) | CodeChef [Medium]

Chef has opened up a new restaurant. He picks out the positive reviews and posts it on the website of the restaurant. A review is considered to be positive if it is among the top one-third of the total reviews when they are sorted by their rating.

Competitive Programming, Heaps, Interview Questions

Generate Pythagorean Triples

Given an integer limit, generate all Pythagorean Triples with values smaller than limit.

Interview Questions, Mathematics

Detect Loop in a Linked List | And Remove Loop

Given the head pointer of a linked list, check if there’s a loop in the linked list. Proof of Floyd’s Cycle-Finding Algorithm.

Interview Questions, Linked Lists

Minimum adjacent swaps required to sort Binary Array in O(n) | Amazon Interview Question

Given an array consisting of only 1s and 0s, sort this binary array such that all 0s are on the left and all 1s are on the right.

Arrays, Greedy approach, Interview Questions

Stock Buy Sell Maximum Profit Solution

The cost of a stock on each day is given in an array. Each day, you can either buy one share, sell any number of shares that you own, or not make any transaction at all.

Competitive Programming, Interview Questions

Find maximum of all subarrays of size k

Given an array of size n and an integer k, we need to find the maximum for each contiguous subarray of size k.

Arrays, Competitive Programming, Interview Questions

Lowest Common Ancestor in a Binary Tree in C++

The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants.

Interview Questions, Trees

Best Time to Buy and Sell Stock [Interview Question]

You are given an array prices where prices[i] is the price of a given stock on the ith day. Return the maximum profit you can achieve from this transaction. If you cannot achieve any profit, return 0.

Arrays, Interview Questions

Find the minimum distance to travel through a road having hills [Interview Question]

Alansh has to travel through a road having hills of different heights. Also each hill has a cave to pass through it, to avoid travelling extra distance of a hill. Alansh wants to travel through this road by taking at most K caves.

Dynamic Programming, Interview Questions

Edit Distance – LeetCode Solution [Hard]

Given two strings word1 and word2 (in lowercase alphabets), return the minimum number of operations required to convert word1 to word2.

Dynamic Programming, Interview Questions

Posts pagination

< 1 2 3 >
  • Algorithms
  • Arrays
  • Backtracking & Recursion
  • Breadth First Search (BFS)
  • C/C++
  • Competitive Programming
  • Computer Science
  • Data Science
  • Databases
  • Depth First Search (DFS)
  • Divide and Conquer
  • Dynamic Programming
  • Graphs
  • Greedy approach
  • Hashmaps
  • Heaps
  • Interview Questions
  • Java
  • Linked Lists
  • Machine Coding Questions
  • Machine Learning
  • Mathematics
  • Networking
  • Programming Projects
  • Python
  • Queues
  • Sorting
  • Special Data Structures
  • Stacks
  • Trees
  • Web Development
© 2025 Only Code | Aureolls
Exit mobile version