Tagged: Beginner

0

Most frequent word

Objective: Given an array of string, write a program to find the word in the array which appears the maximum number of times. Example: Input: [Algorithms, String, Integer, Integer, Algorithms, String, Integer, Algorithms, String,...

0

Given an array, count the number of pairs with a given sum.

Objective: Given an array of integers, write a program to count all the pairs with the given sum. Example: Given array: [1, 5, 7, 1, -1], Sum= 6 Total Pairs: 3 Note: pairs are...

0

Print sorted unique elements of a given array

Objective: Given an array of integers with duplicates, write a program to print unique elements in the array in sorted order. Example: Given Input: [6, 1, 8, 5, 2, 10, 17, 25, 6, 5,...

0

Find the sum of overlapping elements in two sets

Objective: Given two sets of integers, write an algorithm to print the sum of overlapping elements in two sets. Note: Elements in each set are unique or there are no duplicates within a set....

0

Given two coordinates, Print the line equation

Objective: Given two coordinates (x1, y1) and (x2, y2). Write a java program to construct a line equation that passes through the given coordinates. Line Equation: Given two coordinates (x1, y1) and (x2, y2)...

0

Print all middle elements of the given matrix/2D array.

Objective: Given a two-dimensional array, write a program to print all middle elements of the array. Or In other words, print all the elements from the array except boundary elements. Example: int [][] grid...

0

Hamming Distance between two given integers

Objective: Given two integers, write an algorithm to calculate the hamming distance between the integers.  Hamming Distance: Hamming distance between two integers is the number of positions at which the bits are different. Example:...

%d bloggers like this: