Manafall Daily Quest

Sequential Digits

Function Name: sequentialDigits

Description

Create a function named sequentialDigits that takes two integers, low and high as input and returns a list of all the integers that contain sequential digits, where each digit is exactly one larger than the previous digit, and the integers are between the range of low and high (inclusive). The output list should be sorted in increasing order.

Requirements

  • The function must be named sequentialDigits.
  • The function should take two integer parameters, low and high.
  • The function must return a list of sorted integers.
  • Each integer in the list must contain only sequential digits.
  • The function should handle cases where no sequential digit numbers exist within the range.
  • Both low and high will be positive integers.
  • The function must not use any third-party libraries or modules.
  • Consider the space and time complexity of your solution.

Examples

Example 1:
Input: sequentialDigits(100, 300)
Output: [123, 234]Example 2:
Input: sequentialDigits(1000, 13000)
Output: [1234, 2345, 3456, 4567, 5678, 6789, 12345]

Links

https://en.wikipedia.org/wiki/Glossary_of_arithmetic_and_diophantine_geometry#Sequence

Adjacent Element Product

Thu Dec 19 2024

You are given an array of integers. Write a function that finds the pair of adjacent elements that has the largest product and returns that product.For example, given the array [3, 6, -2, -5, 7, 3], the function should find the pair (7, 3) and return 21.

Prev Quest

Labyrinth Escape

Sat Dec 21 2024

Write a function 'findEscapeRoute' that determines if there is a way out of a labyrinth represented as a 2D grid. The labyrinth is a matrix of characters where 'O' represents open passages, 'X' represents walls, and 'E' represents the exit. The function should take two parameters: a matrix of characters representing the labyrinth, and a tuple or an array representing the starting position (row, column). The starting position will always be an open passage. The function should return a boolean value indicating whether there is a way to reach the exit 'E' from the starting position. The movement is restricted to up, down, left, and right and cannot pass through walls.

Next Quest