Cerinta completa We define subsequence as any subset of an array. We define a subarray as a contiguous subsequence in an array. Given an array, find the maximum possible sum among: all nonempty subarrays. all nonempty subsequences. Print the two
Array Manipulation
Cerinta completa Starting with a 1-indexed array of zeros and a list of operations, for each operation add a value to each array element between two given indices, inclusive. Once all operations have been performed, return the maximum value in
Wet Shark and Two Subsequences
Cerinta completa One day, Wet Shark was given an array . As always, he started playing with its subsequences. When you came to know about this habit, you presented him a task of finding all pairs of subsequences, , which
The Love-Letter Mystery
Cerinta completa James found a love letter that his friend Harry has written to his girlfriend. James is a prankster, so he decides to meddle with the letter. He changes all the words in the letter into palindromes. To do
Vim War
Cerinta completa A war has broken down between Vim and Emacs. Gedit, being Vim’s ally, is captured by Emacs as a prisoner of war and it is up to Vim to rescue him by defeating Emacs. For this task, Vim
AND xor OR
Cerinta completa Given an array of distinct elements. Let and be the smallest and the next smallest element in the interval where . . where , are the bitwise operators , and respectively. Your task is to find the maximum
The Indian Job
Cerinta completa It is the Indian version of the famous heist “The Italian Job”. N robbers have already broken into the National Museum and are just about to get inside the main vault which is full of jewels. They were
The Hurdle Race
Cerinta completa A video player plays a game in which the character competes in a hurdle race. Hurdles are of varying heights, and the characters have a maximum height they can jump. There is a magic potion they can take
Unique Divide And Conquer
Cerinta completa Divide-and-Conquer on a tree is a powerful approach to solving tree problems. Imagine a tree, , with vertices. Let’s remove some vertex from tree , splitting into zero or more connected components, , with vertices . We can
The Full Counting Sort
Cerinta completa Use the counting sort to order a list of strings associated with integers. If two strings are associated with the same integer, they must be printed in their original order, i.e. your sorting algorithm should be stable. There
