Showing 6 questions
Determine the length of the longest subsequence within a binary string that consists of alternating groups of 0s and 1s. You are allowed to remove characters to achieve this alternating pattern.
#1. Alternating Groups II
Determine the maximum length of alternating groups (even-odd or odd-even) within a given array. Find the longest sequence where adjacent numbers have different parity.
#2. Alternating Groups I
Determine if a given 9x9 Sudoku board is valid. Check if each row, column, and 3x3 subgrid contains the digits 1-9 without repetition.
#3. Valid Sudoku
Given a string and two substrings, find the indices where the first substring occurs. Then, find the indices where the second substring occurs. Return the indices of the first substring that are close to any index of the second substring, within a specified range.
#4. Find Beautiful Indices in the Given Array I
Given a sequence of words and a line width, format the text to fit within the specified width. You must justify the text, distributing extra spaces evenly between words.
#5. Text Justification
Imagine people entering and leaving a flower garden at different times. Given the arrival and departure times for each person, and the bloom period for each flower, determine how many flowers are in full bloom when each person is in the garden.
#6. Number of Flowers in Full Bloom