Looking for good programming challenges?

Use the search below to find our solutions for selected questions!

All posts tagged booking.com

Sort hotel list challenge

Problem statement Given a set of hotels and its guests reviews, sort the hotels based on a list of words specified by a user. The criteria to sort the hotels should be how many times the words specified by the user is mentioned in the hotel reviews. Input The first . . . Read more

Delta encoding challenge

Problem statement Given a list of numbers, e.g.: 25626 25757 24367 24267 16 100 2 7277 Output a delta encoding for the sequence. In a delta encoding, the first element is reproduced as is. Each subsequent element is represented as the numeric difference from the element before it. E.g. for . . . Read more

Sum of 2 numbers in an array

Problem statement Identify whether there exists a pair of numbers in an array such that their sum is equal to . Input The first line contains one integer , which is the sum we are trying to find. The second line contains one integer , which is the length of . . . Read more

Polygons challenge

Problem statement Identify whether four sides (given by four integers) can form a square, a rectangle, or neither. Input You will receive an list of strings, each containing four space-separated integers, which represent the length of the sides of a polygon. The input lines will follow the ‘A B C . . . Read more

Binary Search Tree to sorted doubly-linked list

Problem statement Given the root of a Binary Search Tree (BST), convert the BST to a sorted doubly linked list in-place. BST is formed only on left and right pointers. prev and next pointers are unassigned initially. Initialise prev and next pointers of Node for creating a doubly-linked list. BST . . . Read more

The maximum continuous and non-continuous subarray challenge

Problem statement Given an array of elements, find the maximum possible sum of a 1. Contiguous subarray 2. Non-contiguous (not necessarily contiguous) subarray. Empty subarrays/subsequences should not be considered. Input Format First line of the input has an integer . cases follow. Each test case begins with an integer . . . . Read more