Examness

Advanced C++

2件の課題 · 学習順

  1. 1Balanced bracketsWrite `bool balanced(const string& s)` - true when every `()[]{}` opens and closes in the right order. Other characters are ignored.stackmatchingearly exit14m
  2. 2Rotate a vector with std::rotateWrite `vector<int> rotate_left(vector<int> v, int k)` returning the vector rotated left by `k` positions. `k` may exceed the size; an empty vector comes back empty.iteratorsstd::rotatemodular index12m