Category: hackerrank

Skipping Subpath Sum

           Skipping Subpath Sum There is a tree  with  vertices numbered from  to . In addition,  is the value assigned to the -th vertex. Consider any path  in the tree. We define a skipping sum of this path to be the maximum of the two below values:  where  is the maximum odd integer not greater than .  where  is the maximum even

Keywords

                     Keywords Given a paragraph of space-separated lowercase English words and a list of unique lowercase English keywords, find the minimum length of the substring of which contains all the keywords that are separated by space in any order. Note: The keywords should be space separated words but

Collatz Sequence Sum

             Collatz Sequence Sum   The following iterative sequence is defined for the set of positive integers:                                                       If at some point the value

Castle Towers

                  Castle Towers Eragon is a dragon that is visiting the town of Osaka. There are n towers of various heights in the city, and tower i has height of height i. Because the taller towers tower over the shorter ones, Eragon can only blow out the

Fraudulent Activity Notifications

             Fraudulent Activity Notifications Hacker Land National Bank has a simple policy for warning clients about possible fraudulent account activity. If the amount spent by a client on a particular day is greater than or equal to 2X the client's median spending for the last d days, they send the client a notification about

Day 7: Arrays

                   Day 7: Arrays Objective Today, we're learning about the Array data structure. Check out the Tutorial tab for learning materials and an instructional video! Task Given an array, , of  integers, print 's elements in reverse order as a single line of space-separated numbers. Input Format The first line contains an integer,  (the size of our

Day 6: Let’s Review

              Day 6: Let's Review Objective Today we're expanding our knowledge of Strings and combining it with what we've already learned about loops. Check out the Tutorial tab for learning materials and an instructional video! Task Given a string, , of length  that is indexed from  to , print its even-indexed and odd-indexed characters as  space-separated strings on a single

Day 8: Dictionaries and Maps

    Day 8: Dictionaries and Maps   Objective Today, we're learning about Key-Value pair mappings using a Map or Dictionary data structure. Check out the Tutorial tab for learning materials and an instructional video! Task Given  names and phone numbers, assemble a phone book that maps friends' names to their respective phone numbers. You will then be given an unknown number of names

Day 5: Loops

                    Day 5: Loops Objective In this challenge, we're going to use loops to help us do some simple math. Check out the Tutorial tab to learn more. Task Given an integer, , print its first  multiples. Each multiple  (where ) should be printed on a new line in the form: n x

Day 4: Class vs. Instance

             Day 4: Class vs. Instance Objective In this challenge, we're going to learn about the difference between a class and an instance; because this is an Object Oriented concept, it's only enabled in certain languages. Check out the Tutorial tab for learning materials and an instructional video! Task Write a Person class with an instance variable, , and a