[CS Academy] Ricocheting BallsRead more
[CS Academy] Points MatchingRead more
[CS Academy] PitmutationRead more
[Codeforces] Round 805 (Div. 3) G2. Passable Paths (hard version)Read more
[Codeforces] Round 805 (Div. 3) G1. Passable Paths (easy version)Read more
[Codeforces] CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) D. Magical ArrayRead more
[Codeforces] Round 808 (Div. 1) B. Difference ArrayRead more
[Codeforces] Round 811 (Div. 3) F. Build a Tree and That Is ItRead more
[LeetCode] Buddy Strings

859. Buddy Strings

Given two strings s and goal, return true if you can swap two letters in s so the result is equal to goal, otherwise, return false.

Swapping letters is defined as taking two indices i and j (0-indexed) such that i != j and swapping the characters at s[i] and s[j].

  • For example, swapping at indices 0 and 2 in "abcd" results in "cbad".
Read more
[Codeforces] Round 816 (Div. 2) D. 2+ doorsRead more