bowang0911/leetcode huggingface dataset:
Find Xor-Beauty of Array

You are given a **0-indexed** integer array `nums`.

The **effective value** of three indices `i`, `j`, and `k` is defined as `((nums[i] | nums[j]) & nums[k])`.

The **xor-beauty** of the array is the XORing of **the effective values of all the possible triplets** of indices `(i, j, k)` where `0 <= i, j, k < n`.

Return _the xor-beauty of_ `nums`.

**Note** that:

*   `val1 | val2` is bitwise OR of `val1` and `val2`.
*   `val1 & val2` is bitwise AND of `val1` and `val2`.

**Example 1:**

**Input:** nums = \[1,4\]
**Output:** 5
**Explanation:** 
The triplets and their corresponding effective values are listed below:
- (0,0,0) with effective value ((1 | 1) & 1) = 1
- (0,0,1) with effective value ((1 | 1) & 4) = 0
- (0,1,0) with effective value ((1 | 4) & 1) = 1
- (0,1,1) with effective value ((1 | 4) & 4) = 4
- (1,0,0) with effective value ((4 | 1) & 1) = 1
- (1,0,1) with effective value ((4 | 1) & 4) = 4
- (1,1,0) with effective value ((4 | 4) & 1) = 0
- (1,1,1) with effective value ((4 | 4) & 4) = 4 
Xor-beauty of array will be bitwise XOR of all beauties = 1 ^ 0 ^ 1 ^ 4 ^ 1 ^ 4 ^ 0 ^ 4 = 5.

**Example 2:**

**Input:** nums = \[15,45,20,2,34,35,5,44,32,30\]
**Output:** 34
**Explanation:** `The xor-beauty of the given array is 34.`

**Constraints:**

*   `1 <= nums.length <= 105`
*   `1 <= nums[i] <= 109`
Maximize the Minimum Powered City

You are given a **0-indexed** integer array `stations` of length `n`, where `stations[i]` represents the number of power stations in the `ith` city.

Each power station can provide power to every city in a fixed **range**. In other words, if the range is denoted by `r`, then a power station at city `i` can provide power to all cities `j` such that `|i - j| <= r` and `0 <= i, j <= n - 1`.

*   Note that `|x|` denotes **absolute** value. For example, `|7 - 5| = 2` and `|3 - 10| = 7`.

The **power** of a city is the total number of power stations it is being provided power from.

The government has sanctioned building `k` more power stations, each of which can be built in any city, and have the same range as the pre-existing ones.

Given the two integers `r` and `k`, return _the **maximum possible minimum power** of a city, if the additional power stations are built optimally._

**Note** that you can build the `k` power stations in multiple cities.

**Example 1:**

**Input:** stations = \[1,2,4,5,0\], r = 1, k = 2
**Output:** 5
**Explanation:** 
One of the optimal ways is to install both the power stations at city 1. 
So stations will become \[1,4,4,5,0\].
- City 0 is provided by 1 + 4 = 5 power stations.
- City 1 is provided by 1 + 4 + 4 = 9 power stations.
- City 2 is provided by 4 + 4 + 5 = 13 power stations.
- City 3 is provided by 5 + 4 = 9 power stations.
- City 4 is provided by 5 + 0 = 5 power stations.
So the minimum power of a city is 5.
Since it is not possible to obtain a larger power, we return 5.

**Example 2:**

**Input:** stations = \[4,4,4,4\], r = 0, k = 3
**Output:** 4
**Explanation:** 
It can be proved that we cannot make the minimum power of a city greater than 4.

**Constraints:**

*   `n == stations.length`
*   `1 <= n <= 105`
*   `0 <= stations[i] <= 105`
*   `0 <= r <= n - 1`
*   `0 <= k <= 109`
Maximum Count of Positive Integer and Negative Integer

Given an array `nums` sorted in **non-decreasing** order, return _the maximum between the number of positive integers and the number of negative integers._

*   In other words, if the number of positive integers in `nums` is `pos` and the number of negative integers is `neg`, then return the maximum of `pos` and `neg`.

**Note** that `0` is neither positive nor negative.

**Example 1:**

**Input:** nums = \[-2,-1,-1,1,2,3\]
**Output:** 3
**Explanation:** There are 3 positive integers and 3 negative integers. The maximum count among them is 3.

**Example 2:**

**Input:** nums = \[-3,-2,-1,0,0,1,2\]
**Output:** 3
**Explanation:** There are 2 positive integers and 3 negative integers. The maximum count among them is 3.

**Example 3:**

**Input:** nums = \[5,20,66,1314\]
**Output:** 4
**Explanation:** There are 4 positive integers and 0 negative integers. The maximum count among them is 4.

**Constraints:**

*   `1 <= nums.length <= 2000`
*   `-2000 <= nums[i] <= 2000`
*   `nums` is sorted in a **non-decreasing order**.

**Follow up:** Can you solve the problem in `O(log(n))` time complexity?
Maximal Score After Applying K Operations

You are given a **0-indexed** integer array `nums` and an integer `k`. You have a **starting score** of `0`.

In one **operation**:

1.  choose an index `i` such that `0 <= i < nums.length`,
2.  increase your **score** by `nums[i]`, and
3.  replace `nums[i]` with `ceil(nums[i] / 3)`.

Return _the maximum possible **score** you can attain after applying **exactly**_ `k` _operations_.

The ceiling function `ceil(val)` is the least integer greater than or equal to `val`.

**Example 1:**

**Input:** nums = \[10,10,10,10,10\], k = 5
**Output:** 50
**Explanation:** Apply the operation to each array element exactly once. The final score is 10 + 10 + 10 + 10 + 10 = 50.

**Example 2:**

**Input:** nums = \[1,10,3,3,3\], k = 3
**Output:** 17
**Explanation:** You can do the following operations:
Operation 1: Select i = 1, so nums becomes \[1,**4**,3,3,3\]. Your score increases by 10.
Operation 2: Select i = 1, so nums becomes \[1,**2**,3,3,3\]. Your score increases by 4.
Operation 3: Select i = 2, so nums becomes \[1,1,**1**,3,3\]. Your score increases by 3.
The final score is 10 + 4 + 3 = 17.

**Constraints:**

*   `1 <= nums.length, k <= 105`
*   `1 <= nums[i] <= 109`
Make Number of Distinct Characters Equal

You are given two **0-indexed** strings `word1` and `word2`.

A **move** consists of choosing two indices `i` and `j` such that `0 <= i < word1.length` and `0 <= j < word2.length` and swapping `word1[i]` with `word2[j]`.

Return `true` _if it is possible to get the number of distinct characters in_ `word1` _and_ `word2` _to be equal with **exactly one** move._ Return `false` _otherwise_.

**Example 1:**

**Input:** word1 =  "ac ", word2 =  "b "
**Output:** false
**Explanation:** Any pair of swaps would yield two distinct characters in the first string, and one in the second string.

**Example 2:**

**Input:** word1 =  "abcc ", word2 =  "aab "
**Output:** true
**Explanation:** We swap index 2 of the first string with index 0 of the second string. The resulting strings are word1 =  "abac " and word2 =  "cab ", which both have 3 distinct characters.

**Example 3:**

**Input:** word1 =  "abcde ", word2 =  "fghij "
**Output:** true
**Explanation:** Both resulting strings will have 5 distinct characters, regardless of which indices we swap.

**Constraints:**

*   `1 <= word1.length, word2.length <= 105`
*   `word1` and `word2` consist of only lowercase English letters.
Number of Good Binary Strings

You are given four integers `minLength`, `maxLength`, `oneGroup` and `zeroGroup`.

A binary string is **good** if it satisfies the following conditions:

*   The length of the string is in the range `[minLength, maxLength]`.
*   The size of each block of consecutive `1`'s is a multiple of `oneGroup`.
    *   For example in a binary string `00110111100` sizes of each block of consecutive ones are `[2,4]`.
*   The size of each block of consecutive `0`'s is a multiple of `zeroGroup`.
    *   For example, in a binary string `00110111100` sizes of each block of consecutive ones are `[2,1,2]`.

Return _the number of **good** binary strings_. Since the answer may be too large, return it **modulo** `109 + 7`.

**Note** that `0` is considered a multiple of all the numbers.

**Example 1:**

**Input:** minLength = 2, maxLength = 3, oneGroup = 1, zeroGroup = 2
**Output:** 5
**Explanation:** There are 5 good binary strings in this example:  "00 ",  "11 ",  "001 ",  "100 ", and  "111 ".
It can be proven that there are only 5 good strings satisfying all conditions.

**Example 2:**

**Input:** minLength = 4, maxLength = 4, oneGroup = 4, zeroGroup = 3
**Output:** 1
**Explanation:** There is only 1 good binary string in this example:  "1111 ".
It can be proven that there is only 1 good string satisfying all conditions.

**Constraints:**

*   `1 <= minLength <= maxLength <= 105`
*   `1 <= oneGroup, zeroGroup <= maxLength`
Time Taken to Cross the Door

There are `n` persons numbered from `0` to `n - 1` and a door. Each person can enter or exit through the door once, taking one second.

You are given a **non-decreasing** integer array `arrival` of size `n`, where `arrival[i]` is the arrival time of the `ith` person at the door. You are also given an array `state` of size `n`, where `state[i]` is `0` if person `i` wants to enter through the door or `1` if they want to exit through the door.

If two or more persons want to use the door at the **same** time, they follow the following rules:

*   If the door was **not** used in the previous second, then the person who wants to **exit** goes first.
*   If the door was used in the previous second for **entering**, the person who wants to enter goes first.
*   If the door was used in the previous second for **exiting**, the person who wants to **exit** goes first.
*   If multiple persons want to go in the same direction, the person with the **smallest** index goes first.

Return _an array_ `answer` _of size_ `n` _where_ `answer[i]` _is the second at which the_ `ith` _person crosses the door_.

**Note** that:

*   Only one person can cross the door at each second.
*   A person may arrive at the door and wait without entering or exiting to follow the mentioned rules.

**Example 1:**

**Input:** arrival = \[0,1,1,2,4\], state = \[0,1,0,0,1\]
**Output:** \[0,3,1,2,4\]
**Explanation:** At each second we have the following:
- At t = 0: Person 0 is the only one who wants to enter, so they just enter through the door.
- At t = 1: Person 1 wants to exit, and person 2 wants to enter. Since the door was used the previous second for entering, person 2 enters.
- At t = 2: Person 1 still wants to exit, and person 3 wants to enter. Since the door was used the previous second for entering, person 3 enters.
- At t = 3: Person 1 is the only one who wants to exit, so they just exit through the door.
- At t = 4: Person 4 is the only one who wants to exit, so they just exit through the door.

**Example 2:**

**Input:** arrival = \[0,0,0\], state = \[1,0,1\]
**Output:** \[0,2,1\]
**Explanation:** At each second we have the following:
- At t = 0: Person 1 wants to enter while persons 0 and 2 want to exit. Since the door was not used in the previous second, the persons who want to exit get to go first. Since person 0 has a smaller index, they exit first.
- At t = 1: Person 1 wants to enter, and person 2 wants to exit. Since the door was used in the previous second for exiting, person 2 exits.
- At t = 2: Person 1 is the only one who wants to enter, so they just enter through the door.

**Constraints:**

*   `n == arrival.length == state.length`
*   `1 <= n <= 105`
*   `0 <= arrival[i] <= n`
*   `arrival` is sorted in **non-decreasing** order.
*   `state[i]` is either `0` or `1`.
Difference Between Element Sum and Digit Sum of an Array

You are given a positive integer array `nums`.

*   The **element sum** is the sum of all the elements in `nums`.
*   The **digit sum** is the sum of all the digits (not necessarily distinct) that appear in `nums`.

Return _the **absolute** difference between the **element sum** and **digit sum** of_ `nums`.

**Note** that the absolute difference between two integers `x` and `y` is defined as `|x - y|`.

**Example 1:**

**Input:** nums = \[1,15,6,3\]
**Output:** 9
**Explanation:** 
The element sum of nums is 1 + 15 + 6 + 3 = 25.
The digit sum of nums is 1 + 1 + 5 + 6 + 3 = 16.
The absolute difference between the element sum and digit sum is |25 - 16| = 9.

**Example 2:**

**Input:** nums = \[1,2,3,4\]
**Output:** 0
**Explanation:**
The element sum of nums is 1 + 2 + 3 + 4 = 10.
The digit sum of nums is 1 + 2 + 3 + 4 = 10.
The absolute difference between the element sum and digit sum is |10 - 10| = 0.

**Constraints:**

*   `1 <= nums.length <= 2000`
*   `1 <= nums[i] <= 2000`
Increment Submatrices by One

You are given a positive integer `n`, indicating that we initially have an `n x n` **0-indexed** integer matrix `mat` filled with zeroes.

You are also given a 2D integer array `query`. For each `query[i] = [row1i, col1i, row2i, col2i]`, you should do the following operation:

*   Add `1` to **every element** in the submatrix with the **top left** corner `(row1i, col1i)` and the **bottom right** corner `(row2i, col2i)`. That is, add `1` to `mat[x][y]` for all `row1i <= x <= row2i` and `col1i <= y <= col2i`.

Return _the matrix_ `mat` _after performing every query._

**Example 1:**

**Input:** n = 3, queries = \[\[1,1,2,2\],\[0,0,1,1\]\]
**Output:** \[\[1,1,0\],\[1,2,1\],\[0,1,1\]\]
**Explanation:** The diagram above shows the initial matrix, the matrix after the first query, and the matrix after the second query.
- In the first query, we add 1 to every element in the submatrix with the top left corner (1, 1) and bottom right corner (2, 2).
- In the second query, we add 1 to every element in the submatrix with the top left corner (0, 0) and bottom right corner (1, 1).

**Example 2:**

**Input:** n = 2, queries = \[\[0,0,1,1\]\]
**Output:** \[\[1,1\],\[1,1\]\]
**Explanation:** The diagram above shows the initial matrix and the matrix after the first query.
- In the first query we add 1 to every element in the matrix.

**Constraints:**

*   `1 <= n <= 500`
*   `1 <= queries.length <= 104`
*   `0 <= row1i <= row2i < n`
*   `0 <= col1i <= col2i < n`
Count the Number of Good Subarrays

Given an integer array `nums` and an integer `k`, return _the number of **good** subarrays of_ `nums`.

A subarray `arr` is **good** if it there are **at least** `k` pairs of indices `(i, j)` such that `i < j` and `arr[i] == arr[j]`.

A **subarray** is a contiguous **non-empty** sequence of elements within an array.

**Example 1:**

**Input:** nums = \[1,1,1,1,1\], k = 10
**Output:** 1
**Explanation:** The only good subarray is the array nums itself.

**Example 2:**

**Input:** nums = \[3,1,4,3,2,2,4\], k = 2
**Output:** 4
**Explanation:** There are 4 different good subarrays:
- \[3,1,4,3,2,2\] that has 2 pairs.
- \[3,1,4,3,2,2,4\] that has 3 pairs.
- \[1,4,3,2,2,4\] that has 2 pairs.
- \[4,3,2,2,4\] that has 2 pairs.

**Constraints:**

*   `1 <= nums.length <= 105`
*   `1 <= nums[i], k <= 109`
Difference Between Maximum and Minimum Price Sum

There exists an undirected and initially unrooted tree with `n` nodes indexed from `0` to `n - 1`. You are given the integer `n` and a 2D integer array `edges` of length `n - 1`, where `edges[i] = [ai, bi]` indicates that there is an edge between nodes `ai` and `bi` in the tree.

Each node has an associated price. You are given an integer array `price`, where `price[i]` is the price of the `ith` node.

The **price sum** of a given path is the sum of the prices of all nodes lying on that path.

The tree can be rooted at any node `root` of your choice. The incurred **cost** after choosing `root` is the difference between the maximum and minimum **price sum** amongst all paths starting at `root`.

Return _the **maximum** possible **cost**_ _amongst all possible root choices_.

**Example 1:**

**Input:** n = 6, edges = \[\[0,1\],\[1,2\],\[1,3\],\[3,4\],\[3,5\]\], price = \[9,8,7,6,10,5\]
**Output:** 24
**Explanation:** The diagram above denotes the tree after rooting it at node 2. The first part (colored in red) shows the path with the maximum price sum. The second part (colored in blue) shows the path with the minimum price sum.
- The first path contains nodes \[2,1,3,4\]: the prices are \[7,8,6,10\], and the sum of the prices is 31.
- The second path contains the node \[2\] with the price \[7\].
The difference between the maximum and minimum price sum is 24. It can be proved that 24 is the maximum cost.

**Example 2:**

**Input:** n = 3, edges = \[\[0,1\],\[1,2\]\], price = \[1,1,1\]
**Output:** 2
**Explanation:** The diagram above denotes the tree after rooting it at node 0. The first part (colored in red) shows the path with the maximum price sum. The second part (colored in blue) shows the path with the minimum price sum.
- The first path contains nodes \[0,1,2\]: the prices are \[1,1,1\], and the sum of the prices is 3.
- The second path contains node \[0\] with a price \[1\].
The difference between the maximum and minimum price sum is 2. It can be proved that 2 is the maximum cost.

**Constraints:**

*   `1 <= n <= 105`
*   `edges.length == n - 1`
*   `0 <= ai, bi <= n - 1`
*   `edges` represents a valid tree.
*   `price.length == n`
*   `1 <= price[i] <= 105`
Count the Number of Good Subsequences

A **subsequence** of a string is good if it is not empty and the frequency of each one of its characters is the same.

Given a string `s`, return _the number of good subsequences of_ `s`. Since the answer may be too large, return it modulo `109 + 7`.

A **subsequence** is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.

**Example 1:**

**Input:** s =  "aabb "
**Output:** 11
**Explanation:** The total number of subsequences is `24.` There are five subsequences which are not good:  "**aab**b ",  "a**abb** ",  "**a**a**bb** ",  "**aa**b**b** ", and the empty subsequence. Hence, the number of good subsequences is `24-5 = 11`.

**Example 2:**

**Input:** s =  "leet "
**Output:** 12
**Explanation:** There are four subsequences which are not good:  "**l_ee_**t ",  "l**eet** ",  "**leet** ", and the empty subsequence. Hence, the number of good subsequences is `24-4 = 12`.

**Example 3:**

**Input:** s =  "abcd "
**Output:** 15
**Explanation:** All of the non-empty subsequences are good subsequences. Hence, the number of good subsequences is `24-1 = 15`.

**Constraints:**

*   `1 <= s.length <= 104`
*   `s` consists of only lowercase English letters.
Minimum Common Value

Given two integer arrays `nums1` and `nums2`, sorted in non-decreasing order, return _the **minimum integer common** to both arrays_. If there is no common integer amongst `nums1` and `nums2`, return `-1`.

Note that an integer is said to be **common** to `nums1` and `nums2` if both arrays have **at least one** occurrence of that integer.

**Example 1:**

**Input:** nums1 = \[1,2,3\], nums2 = \[2,4\]
**Output:** 2
**Explanation:** The smallest element common to both arrays is 2, so we return 2.

**Example 2:**

**Input:** nums1 = \[1,2,3,6\], nums2 = \[2,3,4,5\]
**Output:** 2
**Explanation:** There are two common elements in the array 2 and 3 out of which 2 is the smallest, so 2 is returned.

**Constraints:**

*   `1 <= nums1.length, nums2.length <= 105`
*   `1 <= nums1[i], nums2[j] <= 109`
*   Both `nums1` and `nums2` are sorted in **non-decreasing** order.
Minimum Operations to Make Array Equal II

You are given two integer arrays `nums1` and `nums2` of equal length `n` and an integer `k`. You can perform the following operation on `nums1`:

*   Choose two indexes `i` and `j` and increment `nums1[i]` by `k` and decrement `nums1[j]` by `k`. In other words, `nums1[i] = nums1[i] + k` and `nums1[j] = nums1[j] - k`.

`nums1` is said to be **equal** to `nums2` if for all indices `i` such that `0 <= i < n`, `nums1[i] == nums2[i]`.

Return _the **minimum** number of operations required to make_ `nums1` _equal to_ `nums2`. If it is impossible to make them equal, return `-1`.

**Example 1:**

**Input:** nums1 = \[4,3,1,4\], nums2 = \[1,3,7,1\], k = 3
**Output:** 2
**Explanation:** In 2 operations, we can transform nums1 to nums2.
1st operation: i = 2, j = 0. After applying the operation, nums1 = \[1,3,4,4\].
2nd operation: i = 2, j = 3. After applying the operation, nums1 = \[1,3,7,1\].
One can prove that it is impossible to make arrays equal in fewer operations.

**Example 2:**

**Input:** nums1 = \[3,8,5,2\], nums2 = \[2,4,1,6\], k = 1
**Output:** -1
**Explanation:** It can be proved that it is impossible to make the two arrays equal.

**Constraints:**

*   `n == nums1.length == nums2.length`
*   `2 <= n <= 105`
*   `0 <= nums1[i], nums2[j] <= 109`
*   `0 <= k <= 105`
Maximum Subsequence Score

You are given two **0-indexed** integer arrays `nums1` and `nums2` of equal length `n` and a positive integer `k`. You must choose a **subsequence** of indices from `nums1` of length `k`.

For chosen indices `i0`, `i1`, ..., `ik - 1`, your **score** is defined as:

*   The sum of the selected elements from `nums1` multiplied with the **minimum** of the selected elements from `nums2`.
*   It can defined simply as: `(nums1[i0] + nums1[i1] +...+ nums1[ik - 1]) * min(nums2[i0] , nums2[i1], ... ,nums2[ik - 1])`.

Return _the **maximum** possible score._

A **subsequence** of indices of an array is a set that can be derived from the set `{0, 1, ..., n-1}` by deleting some or no elements.

**Example 1:**

**Input:** nums1 = \[1,3,3,2\], nums2 = \[2,1,3,4\], k = 3
**Output:** 12
**Explanation:** 
The four possible subsequence scores are:
- We choose the indices 0, 1, and 2 with score = (1+3+3) \* min(2,1,3) = 7.
- We choose the indices 0, 1, and 3 with score = (1+3+2) \* min(2,1,4) = 6. 
- We choose the indices 0, 2, and 3 with score = (1+3+2) \* min(2,3,4) = 12. 
- We choose the indices 1, 2, and 3 with score = (3+3+2) \* min(1,3,4) = 8.
Therefore, we return the max score, which is 12.

**Example 2:**

**Input:** nums1 = \[4,2,3,1,1\], nums2 = \[7,5,10,9,6\], k = 1
**Output:** 30
**Explanation:** 
Choosing index 2 is optimal: nums1\[2\] \* nums2\[2\] = 3 \* 10 = 30 is the maximum possible score.

**Constraints:**

*   `n == nums1.length == nums2.length`
*   `1 <= n <= 105`
*   `0 <= nums1[i], nums2[j] <= 105`
*   `1 <= k <= n`
Check if Point Is Reachable

There exists an infinitely large grid. You are currently at point `(1, 1)`, and you need to reach the point `(targetX, targetY)` using a finite number of steps.

In one **step**, you can move from point `(x, y)` to any one of the following points:

*   `(x, y - x)`
*   `(x - y, y)`
*   `(2 * x, y)`
*   `(x, 2 * y)`

Given two integers `targetX` and `targetY` representing the X-coordinate and Y-coordinate of your final position, return `true` _if you can reach the point from_ `(1, 1)` _using some number of steps, and_ `false` _otherwise_.

**Example 1:**

**Input:** targetX = 6, targetY = 9
**Output:** false
**Explanation:** It is impossible to reach (6,9) from (1,1) using any sequence of moves, so false is returned.

**Example 2:**

**Input:** targetX = 4, targetY = 7
**Output:** true
**Explanation:** You can follow the path (1,1) -> (1,2) -> (1,4) -> (1,8) -> (1,7) -> (2,7) -> (4,7).

**Constraints:**

*   `1 <= targetX, targetY <= 109`
Alternating Digit Sum

You are given a positive integer `n`. Each digit of `n` has a sign according to the following rules:

*   The **most significant digit** is assigned a **positive** sign.
*   Each other digit has an opposite sign to its adjacent digits.

Return _the sum of all digits with their corresponding sign_.

**Example 1:**

**Input:** n = 521
**Output:** 4
**Explanation:** (+5) + (-2) + (+1) = 4.

**Example 2:**

**Input:** n = 111
**Output:** 1
**Explanation:** (+1) + (-1) + (+1) = 1.

**Example 3:**

**Input:** n = 886996
**Output:** 0
**Explanation:** (+8) + (-8) + (+6) + (-9) + (+9) + (-6) = 0.

**Constraints:**

*   `1 <= n <= 109`

.spoilerbutton {display:block; border:dashed; padding: 0px 0px; margin:10px 0px; font-size:150%; font-weight: bold; color:#000000; background-color:cyan; outline:0; } .spoiler {overflow:hidden;} .spoiler > div {-webkit-transition: all 0s ease;-moz-transition: margin 0s ease;-o-transition: all 0s ease;transition: margin 0s ease;} .spoilerbutton\[value="Show Message"\] + .spoiler > div {margin-top:-500%;} .spoilerbutton\[value="Hide Message"\] + .spoiler {padding:5px;}