📅  最后修改于: 2022-03-11 15:04:37.144000             🧑  作者: Mango
function hydrate(s) {
let waterCount = s.split('').filter(e => e.match(/\d/)).reduce((acc, val) => +acc + +val, 0);
return waterCount > 1 ? `${waterCount} glasses of water`: `${waterCount} glass of water`;
}