Delete Even
Given a linked list of integers, return a linked list containing only nodes having odd integers in their node->data field.
Example
n=3
listHead=1->4->7
The linked list containing only nodes having odd integers is 1 -> 7.
Function Description
Complete the function deleteEven in the editor below.
deleteEven has the following parameter(s):
list listHead: a reference t
Asked in: Amazon
String Subarrays
Problem Statement
Aarav, an aspiring linguist and programming enthusiast, enjoys finding patterns in words and letters. One day, while reading about the importance of vowels in the English language, he stumbles upon an interesting problem that blends his love for both linguistics and coding.
He is given an array of size N, where each element is a single English alphabet. As
Asked in: Walmart
Unique Encryptions in Nexus Prime
| Problem Statement
In the futuristic city of Nexus Prime, a tech organization stores large amounts of encrypted data files. Each file's content is scrambled using different arrangements of letters to create unique encryption patterns. Dr. Axiom, the lead engineer, needs to figure out how many different ways a file can be scrambled (encrypted). As the size of
Asked in: Walmart
Counting Repeated Game Scores
During a school sports day event, students record their scores, However, some students accidentally recorded the same score multiple times. Your task is to help the event organizer identify all scores that are repeated and determine the indices where each duplicate occurs.
You are given an integer N, representing the number of students, followed by a list of the
Asked in: Walmart
Ruest for Mystic Numbers
Problem Statement
the land of Numeria, the ancient sages have discovered a magical property in me numbers that they call "Mystic Numbers". These numbers hold special wers that can influence the harmony of the universe. You, as an apprentice to e sages, have been tasked with identifying these MysticNumbers.
The sages define a Mystic Number as follows:
1. It must b
Asked in: Walmart
Will We Meet
In the bustling town of Skyline Street, Jatin and Mano, two childhood friends, often challenge each other to exciting games. One day, they came up with a unique adventure-"The Climb of Heights."
Skyline Street consists of N buildings, each with a unique height, forming a magnificent skyline. The friends decide to start from their respective buildings and see if they can meet on
Asked in: Walmart
Homework
The distance between 2 points (x y1) and (x2 y2) on a 2D plane is defined as But Paul, the math teacher, defined the distance between 2 points (x1, y1) and (x2,y2) on a 2D plane as min(|z1-z2l, [y/1 - val) in his class. As homework, he gave N points to the students and asked Min smallest distance between all possible pairs of points according to his new definition. You are given N poin
Asked in: Nokia
The city of Hackerland can be represented using a grid with n rows and m columns containing an empty cell represented by a '*' and a blocked cell represented by a #. Traveling is allowed only through empty cells. The people of Hackerland are required to travel from a starting cell defined by the character 'S' to an ending cell represented by a character 'E'.
The people can jump a length of any
Asked in: Meesho
Given an array of strings, each of the same length, and a target string, construct the target string using characters from the strings in the given array such that the indices of the characters in the order in which they are used form a strictly increasing sequence. Here the index of a character is the
position at which it appears in the string. Note that it is acceptable to use multiple characte
Asked in: Meesho
A pixel color RGB is defined as a 24 bit integer. Each 8 bit integer (1 byte) represents either red, green or blue color. Each 8 bit integer has an integer value between 0 (Low intensity) and 255 (High intensity)
For the distance between two pixels having RGB values (r1, g1, b1) and (r2, 82, b2), it is calculated as follows:
d = square_root( (r1-r2)^2+ (g1-g2)^2+ (b1- b2)^2)
Given a 24-bi
Asked in: Meesho