1758. Minimum Changes To Make Alternating Binary String
You are given a string s consisting only of the characters '0' and '1'. In one operation, you can change any '0' to '1' or vice versa. The string is called alternating if no two adjacent characters are equal. For example, the string "010" is alternating, while the string "0100" is not. Return the minimum number of operations needed to make s alternating.
3754. Concatenate Non-Zero Digits and Multiply by Sum I
You are given an integer n. Form a new integer x by concatenating all the non-zero digits of n in their original order. If there are no non-zero digits, x = 0. Let sum be the sum of digits in x. Return an integer representing the value of x * sum.
3870. Count Commas in Range
You are given an integer n.Return the total number of commas used when writing all integers from [1, n] (inclusive) in standard number formatting.In standard formatting:A comma is inserted after every three digits from the right.Numbers with fewer than 4 digits contain no commas.
3903. Smallest Stable Index I
You are given an integer array nums of length n and an integer k. For each index i, define its instability score as max(nums[0..i]) - min(nums[i..n - 1]).In other words max(nums[0..i]) is the largest value among the elements from index 0 to index i.min(nums[i..n - 1]) is the smallest value among the elements from index i to index n - 1.An index i is called stable if its instability score is less than or equal to k.Return the smallest stable index. If no such index exists, return -1.
3904. Smallest Stable Index II
You are given an integer array nums of length n and an integer k.For each index i, define its instability score as max(nums[0..i]) - min(nums[i..n - 1]).In other words:max(nums[0..i]) is the largest value among the elements from index 0 to index i.min(nums[i..n - 1]) is the smallest value among the elements from index i to index n - 1.An index i is called stable if its instability score is less than or equal to k.Return the smallest stable index. If no such index exists, return -1.