Cerinta completa You are given a table, , with rows and columns. The top-left corner of the table has coordinates , and the bottom-right corner has coordinates . The cell contains integer . A path in the table is a
Fair Rations
Cerinta completa You are the benevolent ruler of Rankhacker Castle, and today you’re distributing bread. Your subjects are in a line, and some of them already have some loaves. Times are hard and your castle’s food stocks are dwindling, so
Find Strings
Cerinta completa A substring is defined as a contiguous sequence of one or more characters in the string. More information on substrings can be found here. You are given n strings w[1], w[2], ……, w[n]. Let S[i] denote the set
Extremum Permutations
Cerinta completa Let’s consider a permutation P = {p1, p2, …, pN} of the set of N = {1, 2, 3, …, N} elements . P is called a magic set if it satisfies both of the following constraints: Given
Favorite sequence
Cerinta completa Johnny, like every mathematician, has his favorite sequence of distinct natural numbers. Let’s call this sequence . Johnny was very bored, so he wrote down copies of the sequence in his big notebook. One day, when Johnny was
Fairy Chess
Cerinta completa Let’s play Fairy Chess! You have an chessboard. An -leaper is a chess piece which can move from some square to some square if ; however, its movements are restricted to up (), down (), left (), and
Fair Cut
Cerinta completa Li and Lu have integers, , that they want to divide fairly between the two of them. They decide that if Li gets integers with indices (which implies that Lu gets integers with indices ), then the measure
Even Tree
Cerinta completa You are given a tree (a simple connected graph with no cycles). Find the maximum number of edges you can remove from the tree to get a forest such that each connected component of the forest contains an
Equal
Cerinta completa Christy is interning at HackerRank. One day she has to distribute some chocolates to her colleagues. She is biased towards her friends and plans to give them more than the others. One of the program managers hears of
Extra Long Factorials
Cerinta completa The factorial of the integer , written , is defined as: Calculate and print the factorial of a given integer. For example, if , we calculate and get . Function Description Complete the extraLongFactorials function in the editor
