## Rearrange the given source code

Given a string str which contains the source code (C/C++/Java code) which is not arranged in a proper way, the task is to format that… Read More »

## ZonedDateTime plusDays() method in Java with Examples

The plusDays() method of ZonedDateTime class in Java is used to add the number of specified days in this ZonedDateTime instance and return a copy… Read More »

## Number of triangles that can be formed with given N points

Given X and Y coordinates of N points on a Cartesian plane. The task is to find the number of possible triangles with the non-zero… Read More »

## Expected number of coin flips to get two heads in a row?

Problem : Find the expected number of times a coin must be flipped to get two heads consecutively? Solution : The key is to observe… Read More »

## Code introspection in Python

Introspection is an ability to determine the type of an object at runtime. Everything in python is an object. Every object in Python may have… Read More »

## Convert Java Object to Json String using Jackson API

JSON Stand for JavaScript Object Notation. It’s a standard text-based format which shows structured data based on JavaScript object syntax. It is commonly used for… Read More »

## Insert a String into another String in Java

Given a String, the task is to insert another string in between the given String at a particular specified index in Java. Examples: Input: originalString… Read More »

## Construct a binary string following the given constraints

Given three integers A, B and X. The task is to construct a binary string str which has exactly A number of 0’s and B… Read More »

## Find the multiple of x which is closest to a^b

Given three integers a, b and x, the task is to get the multiple of x which is closest to ab. Examples: Input: a =… Read More »

## Ceiling of every element in same array

Given an array of integers, find the closest smaller or same element for every element. If all elements are greater for an element, then print… Read More »

## Check if a triplet with given sum exists in BST

Given a Binary Search Tree and a SUM. The task is to check if there exists any triplet(group of 3 elements) in the given BST… Read More »

## C# | Getting an enumerator for the entire ArrayList

ArrayList.GetEnumerator Method is used to get an enumerator for the entire ArrayList. Syntax: public virtual System.Collections.IEnumerator GetEnumerator (); Return Value: It returns an IEnumerator for… Read More »

## C# | Adding the elements to the end of the ArrayList

ArrayList.AddRange(ICollection) Method is used to add the elements of an ICollection to the end of the ArrayList. Syntax: public virtual void AddRange (System.Collections.ICollection c); Here,… Read More »

## Futuristic Solution to Privacy and Security in online social media

Social media has become an important part of our lives. This has led to rising of lots of messaging apps like Messenger, WhatsApp and so… Read More »