Skip to content

Instantly share code, notes, and snippets.

View krionbsd's full-sized avatar

Kirill Ponomarev krionbsd

View GitHub Profile
Given an integer array arr, count element x such that x + 1 is also in arr.
If there're duplicates in arr, count them seperately.
Example 1:
Input: arr = [1,2,3]
Output: 2

Keybase proof

I hereby claim:

  • I am krionbsd on github.
  • I am krion (https://keybase.io/krion) on keybase.
  • I have a public key ASCWp4dDzfQLYLPRFVUqN6ObX1zKZ7ju8JNzCka8pYyWLwo

To claim this, I am signing this object:

[WARNING ] /usr/local/lib/python3.6/site-packages/salt/transport/ipc.py:292: DeprecationWarning: encoding is deprecated, Use raw=False instead.
self.unpacker = msgpack.Unpacker(encoding=encoding)
[WARNING ] /usr/local/lib/python3.6/site-packages/salt/payload.py:149: DeprecationWarning: encoding is deprecated, Use raw=False instead.
ret = msgpack.loads(msg, use_list=True, ext_hook=ext_type_decoder, encoding=encoding)
Salt Version:
Salt: 2019.2.0
Dependency Versions: