Palak Bansalpalakbansal.hashnode.dev·Jul 10, 2024Greedy Algorithm - Jump GameYou are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position. Return true if you can reach the last index, or false otherwise. Example...DiscussDSA and Problem Solvinggreedy algorithms
Palak Bansalpalakbansal.hashnode.dev·Jul 8, 2024Greedy Algorithm - Shortest Job First (SJF) CPU Scheduling// Input list of process execution times const input = [4, 3, 7, 1, 2]; // Function to calculate the average waiting time using SJF function averageWaitingTimeSJF(processTimes) { // Sort the process times in ascending order const sortedTimes...DiscussDSA and Problem Solvinggreedy algorithms
Palak Bansalpalakbansal.hashnode.dev·Jul 7, 2024Greedy Algorithm - Lemonade ChangeAt a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you and order one at a time (in the order specified by bills). Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must pr...DiscussDSA and Problem Solvinggreedy algorithms
Palak Bansalpalakbansal.hashnode.dev·Jul 6, 2024Greedy Algorithm - Assign CookiesAssume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor g[i], which is the minimum size of a cookie that the child will be content with; and eac...DiscussDSA and Problem SolvingDSA
Allan N Kichekiche-allan.hashnode.dev·Jul 1, 202355. Jump GameHello, Welcome to my July Challenge of Problem Solving and finding solutions to Leetcode's Data Structures and Algorithm questions. Here, I choose a question daily and try to solve it, and finally pen down my process of flow in solving the question. ...DiscussPython