Prabhdeep Singh has Published 197 Articles

Capitalize 1st character of all words having at least K characters

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 10:28:01

35 Views

In the English language while writing a sentence we need to start with the capital character and for any name of the city/person, etc we begin with the capital letter. Here in this problem, we are given a string and a number and we have to update the first character ... Read More

Minimize cost by splitting the given Array into subsets of size K and adding the highest K/2 elements of each subset into the cost

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 10:21:32

57 Views

Splitting the array means we have to divide the array and make subsets. Here in this problem, we have given an array of integers with size n and integer k and our goal is to calculate the lowest cost by splitting the whole given array into the subsets of size ... Read More

Calculate server loads using Round Robin Scheduling

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 15:57:59

337 Views

Round robins scheduling is used in CPU scheduling, we are given some M number of servers and N number of requests. Each request has some arrival time and processing time. We have to find the load on each server using the Round-Robin Scheduling for which we are going to implement ... Read More

Generate Linked List consisting of maximum difference of squares of pairs of nodes from given Linked List

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 15:56:44

32 Views

A linked list is a linear data structure that consists of nodes and each node is not present in the contiguous form in the main memory, instead, each node contains the address of the next node. We are given a linked list of even length, we have to create a ... Read More

Dumping queue into list or array in Python

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 15:54:25

99 Views

A queue is a linear data structure that works on the FIFO property where each element is added to the queue from the rear and the elements are extracted from the front and use the principle of first in first out. In the list, we can access every element while ... Read More

K-th Smallest Element in an Unsorted Array using Priority Queue

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 15:53:20

173 Views

A priority queue is a heap-based data structure, stores elements in such a way that the greatest or smallest element always be present on the top. We are given an array that is unsorted and we have to find the Kth smallest element from it using the Priority Queue. Here, ... Read More

Find the winner of game of repeatedly removing the first character to empty given string

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 15:51:29

42 Views

In this game, we are given an array of strings of length N. Each string consists of the digits 1 to N only. The game starts with the first person and removes the first character of the 0th index, then the removed character from the string digit number player will ... Read More

Count levels in a Binary Tree consisting of nodes valued 1 grouped together

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 15:47:42

76 Views

A binary tree is a tree where each node has a maximum of two children. We are given a binary tree that consists of only 0 and 1 as the node values. We have to find the number of levels of the binary tree that consists of at least one ... Read More

Minimize cost to convert all characters of a binary string to 0s

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 14:29:16

54 Views

A binary string is a string that only contains the binary numbers in it. In this problem, we are given a binary string, an array that represents the last index up to which we can flip the ones after starting from the ith index which will cost and cost for ... Read More

Maximize product of array by replacing array elements with its sum or product with element from another array

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 14:26:07

90 Views

We are given two arrays of the same length and we have to apply some operations to get the product of the first array with all elements maximum. The operations are to multiply or add any element of the second array only once to any element of the first array ... Read More

Advertisements