Company: Amazon_13sep
Difficulty: medium
Lexicographically Smallest Sequence Problem Description A data science team is building a small utility that manufactures synthetic data points based on patterns learned from existing datasets. Their prototype accepts two integers, n and sequence_sum , and produces a sequence of length n whose elements sum to sequence_sum , where the absolute values of those elements together form a permutation of size n . Among every sequence meeting these conditions, the utility reports the lexicographically smallest one. Given two integers, n , and sequence_sum , return the lexicographically smallest sequence of integers such that: The sum of its elements equals sequence_sum . The absolute values of its elements form a permutation of size n . Note: A sequence of n integers is a permutation if it contains all integers from 1 to n exactly once. For example, [1, 2, 3, 4, 5] is a permutation but [2, 2, 3, 4, 5] is not. When the problem states "absolute values of its elements form a permutation of size n