Best Time to Buy and Sell Stock

Problem Statement The problem “Best Time to Buy and Sell Stock” states that you are given an array of prices of length n, where the ith element stores the price of stock on ith day. If we can make only one transaction, that is, to buy on one day and …

Read more

Implementation of Deque using Doubly Linked List

Problem Statement The problem “Implementation of Deque using Doubly Linked List” states that you need to implement the following functions of Deque or Doubly Ended Queue using a doubly linked list, insertFront(x) : Add element x at the starting of Deque insertEnd(x) : Add element x at the end of …

Read more

Text Justification LeetCode Solution

We will discuss Text Justification LeetCode Solution today Problem Statement The problem “Text Justification” states that you are given a list s[ ] of type string of size n and an integer size. Justify the text such that each line of text consists of size number of characters. You can …

Read more

Reverse individual words

Problem Statement The problem “Reverse individual words” states that you are given a string s. Now, print the reverse of all the individual words in the string. Example s = “TutorialCup – changing the way of learning” puClairotuT – gnignahc eht yaw fo gninrael  s = “Reverse individual words” esreveR …

Read more

Translate »