Tutorials
Courses
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
32.7K+ articles
DSA
20.1K+ articles
Experiences
15.9K+ articles
Interview Experiences
14.1K+ articles
Misc
7.8K+ articles
Recursion
598+ articles
Graph
570+ articles
Advanced Data Structure
311+ articles
Analysis of Algorithms
194+ articles
Data Structures
33+ articles
DSA
/
Algorithms
/
Greedy
Greedy
1.4K+ posts
Recent Articles
Popular Articles
Maximum profit
Last Updated: 24 February 2024
Given N different tasks to be completed where the ith task belongs to a certain category, denoted by category[i], and has an associated reward represented by reward[i].The...
read more
Greedy
Geeks Premier League
DSA
Geeks Premier League 2023
Minimum operations to complete all tasks
Last Updated: 10 June 2024
Given an array arr[] representing the time required to complete n tasks. Each task has a specified time required for its completion. In each operation, one task is selecte...
read more
Greedy
DSA
priority-queue
Minimize difference by multiplying odds by K and dividing evens by 2
Last Updated: 28 April 2024
Given an array arr[] of size N and an integer K which is a power of 2. The task is to minimize the difference between the maximum and minimum elements of the array by repe...
read more
Greedy
Mathematical
Geeks Premier League
DSA
Geeks Premier League 2023
Minimum operations to reduce array elements to zero using prefix operations and updates
Last Updated: 26 March 2024
Given an array arr[] of length N. We can apply 2 types of operations on element of arr[]:Choose a prefix let say arr[0, i] (0 = i N) and decrement all elements of prefix ...
read more
Greedy
Geeks Premier League
DSA
Arrays
Geeks Premier League 2023
Minimize the maximum subarray sum with 1s and -2s
Last Updated: 05 March 2024
Given two integers X and Y. X and Y represent the frequency of elements 1 and -2 you have. You have to arrange all elements such that the maximum sum over all subarrays is...
read more
Greedy
Geeks Premier League
DSA
Arrays
Geeks Premier League 2023
Minimum number of operations required to make all elements equal
Last Updated: 07 March 2024
Given an array arr[] of length N along with an integer M. All the elements of arr[] are in the range [1, N]. Then your task is to output the minimum number of operations r...
read more
Greedy
Geeks Premier League
DSA
Arrays
Geeks Premier League 2023
Construct string having all possible strings of K letters as subsequence
Last Updated: 04 March 2024
Given two positive integers, let's denote them as N and K. The task is to construct a string S such that all possible strings of length N formed using the first K lowercas...
read more
Strings
Greedy
Geeks Premier League
DSA
GeeksforGeeks
Geeks Premier League 2023
Maximizing GCD by Partitioning a Number into K Parts
Last Updated: 16 March 2024
Given a number N, break the number into K positive integers a1, a2, a3 .... aK such that a1 + a2 + a3 .... aK = N. The task is to maximize the GCD(a1, a2, a3 .... aK).Exam...
read more
Greedy
Geeks Premier League
DSA
GCD-LCM
Geeks Premier League 2023
Find maximum frequency of any point across all ranges
Last Updated: 12 March 2024
Given a 2D array ranges[][] of size N denoting N ranges of points. Find the maximum frequency of any point across all the ranges.Examples:Input: ranges[][] = {{1, 4}, {3, ...
read more
Greedy
Geometric
DSA
Greedy Algorithms
Greedy Algorithms
Last Updated: 07 April 2025
Greedy algorithms are a class of algorithms that make locally optimal choices at each step with the hope of finding a global optimum solution. At every step of the algorit...
read more
Greedy
DSA
Algorithms-Greedy Algorithms
Put Maximum Number of Boxes Into the Warehouse II
Last Updated: 23 April 2024
You are given two arrays of positive integers, boxes[] and warehouse[]. The boxes array represents the heights of some boxes of unit width, and the warehouse array represe...
read more
Greedy
Picked
DSA
Arrays
Google
two-pointer-algorithm
Common Slot for Meeting of Two Persons
Last Updated: 22 March 2025
You are given two lists of availability time slots, slt1[][] and slt2[][], for two people. Each slot is represented as [start, end], and it is guaranteed that within each ...
read more
Greedy
Sorting
Picked
DSA
Adobe
Maximum Cinema Seat Allocation
Last Updated: 14 June 2024
A cinema has n rows of seats, numbered from 1 to n and there are ten seats in each row, labelled from 1 to 10 as shown in the figure above.Given the array reservedSeats co...
read more
Greedy
Picked
DSA
Microsoft
Maximum Meetings in One Room
Last Updated: 10 September 2024
Givennmeetings in the form ofstart[]andend[], where start[i] is the start time of ith meeting and end[i] is the end time of ith meeting. The task is to find the maximum nu...
read more
Greedy
Sorting
DSA
Assign Cookies
Last Updated: 26 October 2024
Given two arrays, greed[] and cookie[] such that greed[i] denotes the minimum cookie size wanted by ith child and cookie[i] denotes the size of ith cookie, the task is to ...
read more
Greedy
Sorting
DSA
1
2
3
4
...
93
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !