0xsweatsweat.hashnode.dev·Jul 12, 2024Split Strings - codewarsThis problem is currently rated as a 6 kyu (ratings on codewars range from 8 (easiest) to 1 (hardest)) problem on codewars, this is it’s description : "Complete the solution so that it splits the string into pairs of two characters. If the string co...Discuss·29 readsPython
0xsweatsweat.hashnode.dev·Jul 11, 2024Moving Zeros To The End - codewarsThis problem is currently rated as a 5kyu*(ratings on codewars range from 8 (easiest) to 1 (hardest))* problem on codewars, this is it’s description : “Write an algorithm that takes an array and moves all of the zeros to the end, preserving the orde...DiscussPython
0xsweatsweat.hashnode.dev·Jul 10, 2024Valid Phone Number - codewarsThis problem is currently rated as a 6 kyu*(difficulty ratings on codewars range from 8 (easiest) to 1 (hardest))* problem at codewars, this is it’s description : “Write a function that accepts a string, and returns true if it is in the form of a ph...DiscussPython
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
Yousef Waelyousefwael02.hashnode.dev·Jul 7, 2024Water Bottles - LeetCode 1518 - Beats 100%In this blog post, we'll explore a fun and practical problem: determining the maximum number of water bottles you can drink given a certain number of initial full water bottles and the ability to exchange a set number of empty bottles for new full on...Discussleetcode
Marvelous Innocentsolutionhackeffect.hashnode.dev·Jul 6, 2024JavaScript Problem Solving: Finding The Multiples Of Numbers Using Loops And Conditions - The ChallengeIntroduction In these challenge we will be exploring the concept and the use of loops and conditional statements in JavaScript while tackling a practical problem. We'll be working on a function that calculates the sum of all the natural numbers (posi...Discuss#solutionhackeffect
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
Mahek Gormahekgor.hashnode.dev·Jul 3, 2024GFG POTD - Remove all occurences of duplicates in a linked listGiven a sorted linked list, delete all nodes that have duplicate numbers (all occurrences), leaving only numbers that appear once in the original list, and return the head of the modified linked list. Examples: Input: Linked List = 23->28->28->35->4...DiscussGeeksForGeek