Waiter

Cerinta completa You are a waiter at a party. There is a pile of numbered plates. Create an empty array. At each iteration, , remove each plate from the top of the stack in order. Determine if the number on

Palindromic Subsets

Cerinta completa Consider a lowercase English alphabetic letter character denoted by . A shift operation on some turns it into the next letter in the alphabet. For example, and , , . Given a zero-indexed string, , of lowercase letters,

Number Game on a Tree

Cerinta completa Andy and Lily love playing games with numbers and trees. Today they have a tree consisting of nodes and edges. Each edge has an integer weight, . Before the game starts, Andy chooses an unordered pair of distinct

Find the permutation

Cerinta completa Consider a permutation, , of integers from to . Let’s determine the of to be the minimum absolute difference between any consecutive integers in : Generate a lexicographically sorted list of all permutations of length having a maximal