In C++ vectors, we can access last element using size of vector using following ways. 1) Using size() Output : 50 100 1) Using back()… Read More »

Given a string, we have to find the longest word in the input string and then calculate the number of characters in this word. Examples:… Read More »

Given a string str and a corner string, we need to find out whether the string is starting and ending with the given corner string… Read More »

PHP comes with a number of built-in functions which is used to sort arrays in an easier way. Here, we are going to discuss a… Read More »

The equalsIgnoreCase() method compares two strings irrespective of the case (lower or upper) of the string. This method returns true if the argument is not… Read More »

Artificial Intelligence and Machine Learning are the terms of computer science. This article discusses some points on the basis of which we can differentiate between… Read More »

Given a integer matrix of odd dimensions (3 * 3, 5 * 5). then the task is to find the sum of the middle row… Read More »

Consider the following codes in java: Output: false Output: true The output is false for the first example and true for the second example. In… Read More »

Given a number, check if it is perfect square or not. Examples: Input : 2500 Output : Yes 2500 is a perfect square. 50 *… Read More »

Loop Invariant Condition: Loop invariant condition is a condition about the relationship between the variables of our program which is definitely true immediately before and… Read More »

Given a set (HashSet or TreeSet) of strings in Java, convert it into an array of strings. Input : Set hash_Set = new HashSet(); hash_Set.add(“Geeks”);… Read More »

Given a sentence str. The problem is to remove all the palindromic words from the given sentence. Examples: Input : str = “Text contains malayalam… Read More »

You are given two positive integer n and k. You have to calculate the maximum possible XOR value of at most k-elements from 1 to… Read More »

How to convert a single character to a string object. Examples: Input : x = ‘a’ Output : string s = “a” Input : x… Read More »

Given a square matrix, swap the element of major and minor diagonals. Major Diagonal Elements of a Matrix : The Major Diagonal Elements are the… Read More »

Given time in hours, find the time in minute at which the minute hand and hour hand coincide in next one hour. Examples : Input… Read More »

Given first term (a), common ratio (r) and a integer N of the Geometric Progression series, the task is to find Nth term of the… Read More »

Given an array of size n of integers in range from 1 to n, we need to find the inverse permutation of that array. An… Read More »

Given the side of a square then find the area of a Circumscribed circle around it. Examples: Input : a = 6 Output : Area… Read More »

Given an array of size N-1 and the mean of N elements (one element is not given). We need to find the missing value X… Read More »