Rookie Compare String Hackerrank Solution

Given three strings, concatenate the strings in lexicographically increasing order to create a single string. For example, given firstString = one, secondString = two, thirdString = three, concatenated in lexicographical order, the result = onethreetwo. Function Description Complete the function compareStrings in the editor below. The function must return a string. compareStrings has the following parameter(s): firstString: a stringsecondString: a stringthirdString: a string Input Format Read more…

Subsequence Weighting Hackerrank Solution

A subsequence of a sequence is a sequence which is obtained by deleting zero or more elements from the sequence.  You are given a sequence A in which every element is a pair of integers  i.e  A = [(a1, w1), (a2, w2),…, (aN, wN)]. For a subseqence B = [(b1, v1), (b2, v2), …., (bM, vM)] of the given sequence :  We call it increasing if for every i (1 <= i < M ) , bi < bi+1.Weight(B) = v1 + Read more…

Minimum Absolute Difference in an Array – Hackerrank solution- Greedy Problem

Consider an array of integers, arr =[arr[0], arr[1], … , arr[n-1]] . We define the absolute difference between two elements, a[i] and a[j] (where i != j), to be the absolute value of a[i] – a[j] . Given an array of integers, find and print the minimum absolute difference between any two elements in the array. For example, given the array arr = [-2,2,4]  we can create 3 pairs of numbers: [-2,2], [-2,4]  and [2,4]. The absolute differences for these pairs Read more…

Luck Balance Hackerrank Solution – Greedy Problem

Lena is preparing for an important coding competition that is preceded by a number of sequential preliminary contests. Initially, her luck balance is 0. She believes in “saving luck”, and wants to check her theory. Each contest is described by two integers, L[i]  and T[i]:  L[i] is the amount of luck associated with a contest. If Lena wins the contest, her luck balance will decrease by L[i]; if she loses it, her luck Read more…

How to print adjacency List in C++( Print adjacency List problem)

Given the number of edges ‘E‘ and vertices ‘V‘ of a bidirectional graph. Your task is to build a graph through the adjacency list and print the adjacency list for each vertex. Input:The first line of input is T denoting the number of testcases.Then first line of each of the T contains two positive integer V and E where ‘V’ is the number of vertex and ‘E’ is Read more…

WHY LIBRE – OFFICE ?

In this short article I am going to tell you about why should we use Libre Office in our professional life. Some Reasons are :- It’s open source. If you are familiar with open source and it’s advantages then there is no need of explanation(developer’s side 💻) but who don’t know, you have the access to source code of program you are using. ✌It’s free Read more…

How to Develop a Mobile App

How Students Can Develop a Mobile App without Knowledge of Coding

As mobile users are increasing day by day, therefore, the popularity of mobile apps is also increasing. The mobile apps have shown their marketing value in almost all the fields of life like e-commerce stores, food delivery, healthcare and online payments etc. In the past, you will have to become a programmer to develop a mobile app. Now, the scenario is changed. If you don’t Read more…

Manipulating Images using Python

Say you are doing internship at freshlybuilt.com and freshlybuilt admin give you the boring job of resizing thousands of images and adding a small logo watermark to the corner of each. Doing this with a basic graphics program such as Paintbrush or Paint would take forever. A fancier graphics application such as Photoshop can do batch processing, but thatsoftware costs hundreds of dollars. Let’s write Read more…

0