leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
2582.cpp (164B)
0 class Solution {
1 public:
2 int passThePillow(int n, int time) const {
3 time = time % ((n - 1) * 2) + 1;
4 return min(time, n * 2 - time);
5 }
6 };