[AtCoder] C - Successive SubtractionRead more
[AtCoder] B - Picking UpRead more
[Codeforces] Round #187 (Div. 2) A. Sereja and BottlesRead more
[Codeforces] ABBYY Cup 3.0 A2. Special TaskRead more
[Codeforces] ABBYY Cup 3.0 - Finals (online version) A1. Oh Sweet BeaveretteRead more
[Codeforces] Round #194 (Div. 2) B. Eight Point SetsRead more
[Codeforces] MemSQL start[c]up Round 2 - online version A. BananaRead more
[LeetCode] People Whose List of Favorite Companies Is Not a Subset of Another List

1452. People Whose List of Favorite Companies Is Not a Subset of Another List

Given the array favoriteCompanies where favoriteCompanies[i] is the list of favorites companies for the ith person (indexed from 0).

Return the indices of people whose list of favorite companies is not a subset of any other list of favorites companies. You must return the indices in increasing order.

Read more
[LeetCode] Map Sum Pairs

677. Map Sum Pairs

Design a map that allows you to do the following:

  • Maps a string key to a given value.
  • Returns the sum of the values that have a key with a prefix equal to a given string.

Implement the MapSum class:

  • MapSum() Initializes the MapSum object.
  • void insert(String key, int val) Inserts the key-val pair into the map. If the key already existed, the original key-value pair will be overridden to the new one.
  • int sum(string prefix) Returns the sum of all the pairs’ value whose key starts with the prefix.
Read more
[LeetCode] Binary String With Substrings Representing 1 To N

1016. Binary String With Substrings Representing 1 To N

Given a binary string s and a positive integer n, return true if the binary representation of all the integers in the range [1, n] are substrings of s, or false otherwise.

A substring is a contiguous sequence of characters within a string.

Read more