0771-0780

771. Jewels and Stones $\star$

772. Basic Calculator III $\star\star\star$

773. Sliding Puzzle $\star\star\star$

774. Minimize Max Distance to Gas Station $\star\star\star$

775. Global and Local Inversions $\star\star$

1
2
3
4
5
6
7
8
9
class Solution {
 public:
  bool isIdealPermutation(vector<int>& A) {
    for (int i = 0; i < A.size(); ++i)
      if (abs(A[i] - i) > 1) return false;

    return true;
  }
};

776. Split BST $\star\star$

777. Swap Adjacent in LR String $\star\star$

778. Swim in Rising Water $\star\star\star$

779. K-th Symbol in Grammar $\star\star$

780. Reaching Points $\star\star\star$