Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
javadev authored Jun 30, 2022
1 parent 248eb7f commit 4282515
Showing 1 changed file with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ Return _the **minimum** score of any possible pair of edge removals on the given

**Output:** 9

**Explanation:** The diagram above shows a way to make a pair of removals. - The 1<sup>st</sup> component has nodes [1,3,4] with values [5,4,11]. Its XOR value is 5 ^ 4 ^ 11 = 10. - The 2<sup>nd</sup> component has node [0] with value [1]. Its XOR value is 1 = 1. - The 3<sup>rd</sup> component has node [2] with value [5]. Its XOR value is 5 = 5. The score is the difference between the largest and smallest XOR value which is 10 - 1 = 9. It can be shown that no other pair of removals will obtain a smaller score than 9.
**Explanation:** The diagram above shows a way to make a pair of removals.

- The 1<sup>st</sup> component has nodes [1,3,4] with values [5,4,11]. Its XOR value is 5 ^ 4 ^ 11 = 10.

- The 2<sup>nd</sup> component has node [0] with value [1]. Its XOR value is 1 = 1.

- The 3<sup>rd</sup> component has node [2] with value [5]. Its XOR value is 5 = 5.

The score is the difference between the largest and smallest XOR value which is 10 - 1 = 9. It can be shown that no other pair of removals will obtain a smaller score than 9.

**Example 2:**

Expand All @@ -33,7 +41,15 @@ Return _the **minimum** score of any possible pair of edge removals on the given

**Output:** 0

**Explanation:** The diagram above shows a way to make a pair of removals. - The 1<sup>st</sup> component has nodes [3,4] with values [4,4]. Its XOR value is 4 ^ 4 = 0. - The 2<sup>nd</sup> component has nodes [1,0] with values [5,5]. Its XOR value is 5 ^ 5 = 0. - The 3<sup>rd</sup> component has nodes [2,5] with values [2,2]. Its XOR value is 2 ^ 2 = 0. The score is the difference between the largest and smallest XOR value which is 0 - 0 = 0. We cannot obtain a smaller score than 0.
**Explanation:** The diagram above shows a way to make a pair of removals.

- The 1<sup>st</sup> component has nodes [3,4] with values [4,4]. Its XOR value is 4 ^ 4 = 0.

- The 2<sup>nd</sup> component has nodes [1,0] with values [5,5]. Its XOR value is 5 ^ 5 = 0.

- The 3<sup>rd</sup> component has nodes [2,5] with values [2,2]. Its XOR value is 2 ^ 2 = 0.

The score is the difference between the largest and smallest XOR value which is 0 - 0 = 0. We cannot obtain a smaller score than 0.

**Constraints:**

Expand Down

0 comments on commit 4282515

Please sign in to comment.