GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • rulcode
  • Sign In

This view

  • Original page
  • New address

GeezerVison is showing rulcode.com — Sparse Table Visualizer & Solution | Rulcode

Fetching algorithms...

    Sparse Table Visualizer & Solution | Rulcode
    Loading problem details...

    59. Sparse Table

    Hard
    Topics
    Hint

    Understand Before Coding

    Visualize This Problem
    Open Visualizer
    Draw Your Approach
    Draw

    Example 1:

    Input: nums = [7, 2, 3, 0, 5, 10, 3, 12, 18], L = 2, R = 5
    Output: 0
    Explanation: The minimum value in the range [2, 5] (inclusive) of the array [7, 2, 3, 0, 5, 10, 3, 12, 18] is 0.

    Example 2:

    Input: nums = [4, 5, 6, 7, 8, 9], L = 0, R = 5
    Output: 4
    Explanation: The minimum value in the range [0, 5] (inclusive) of the array [4, 5, 6, 7, 8, 9] is 4.

    Example 3:

    Input: nums = [1, 2, 3, 4, 5], L = 0, R = 0
    Output: 1
    Explanation: The minimum value in the range [0, 0] of the array [1, 2, 3, 4, 5] is 1.

    Example 4:

    Input: nums = [5, 4, 3, 2, 1], L = 2, R = 4
    Output: 1
    Explanation: The minimum value in the range [2, 4] of the array [5, 4, 3, 2, 1] is 1.

    Example 5:

    Input: nums = [10, 20, 30, 40, 50], L = 1, R = 3
    Output: 20
    Explanation: The minimum value in the range [1, 3] of the array [10, 20, 30, 40, 50] is 20.

    Constraints:

    • •
    • •
    • •
    • •

    Time Complexity

    O(1)

    Space Complexity

    O(n log n)

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.