📌  相关文章
📜  在javascript代码示例中保存囚犯hackerrank解决方案

📅  最后修改于: 2022-03-11 15:02:32.955000             🧑  作者: Mango

代码示例1
// save the prisoner hackerrank solution in javascript
function saveThePrisoner(n, m, s) {
  // Write your code here
    let last = 0;
    last = (m + s - 1) % n;
    if (last === 0) {
      last = n;
    }
  return last;
}