[AtCoder] C - Connect 6Read more
[Codeforces] Round #651 (Div. 2) C. Number GameRead more
[Codeforces] Round #653 (Div. 3) D. Zero Remainder ArrayRead more
[Codeforces] Global Round 9 C. Element ExterminationRead more
[Codeforces] Educational Round 91 (Rated for Div. 2) B. Universal SolutionRead more
[Codeforces] Educational Round 91 (Rated for Div. 2) C. Create The TeamsRead more
[LeetCode] Binary Tree Pruning

814. Binary Tree Pruning

Given the root of a binary tree, return the same tree where every subtree (of the given tree) not containing a 1 has been removed.

A subtree of a node node is node plus every node that is a descendant of node.

Read more
[LeetCode] Score After Flipping Matrix

861. Score After Flipping Matrix

You are given an m x n binary matrix grid.

A move consists of choosing any row or column and toggling each value in that row or column (i.e., changing all 0’s to 1’s, and all 1’s to 0’s).

Every row of the matrix is interpreted as a binary number, and the score of the matrix is the sum of these numbers.

Return the highest possible score after making any number of moves (including zero moves).

Read more
[LeetCode] Minimum Number of Steps to Make Two Strings Anagram

1347. Minimum Number of Steps to Make Two Strings Anagram

You are given two strings of the same length s and t. In one step you can choose any character of t and replace it with another character.

Return the minimum number of steps to make t an anagram of s.

An Anagram of a string is a string that contains the same characters with a different (or the same) ordering.

Read more
[LeetCode] Reveal Cards In Increasing Order

950. Reveal Cards In Increasing Order

You are given an integer array deck. There is a deck of cards where every card has a unique integer. The integer on the ith card is deck[i].

You can order the deck in any order you want. Initially, all the cards start face down (unrevealed) in one deck.

You will do the following steps repeatedly until all cards are revealed:

  1. Take the top card of the deck, reveal it, and take it out of the deck.
  2. If there are still cards in the deck then put the next top card of the deck at the bottom of the deck.
  3. If there are still unrevealed cards, go back to step 1. Otherwise, stop.

Return an ordering of the deck that would reveal the cards in increasing order.

Note that the first entry in the answer is considered to be the top of the deck.

Read more