Category: Performance Optimization

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 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