function countWaysTripleSteps(n) {
  let ways = 0;

  for(let z = 0; z <= n/3; z++) {
    for(let y = 0; y <= n/2; y++) {
      for(let x = 0; x <= n; x++) {
        if(n === 1 * x + 2 * y + 3 * z) {
          ways++;
        }
      }
    }
  }

  return ways;
}
Brute force O(n^3)

Order doesn't matter. E.g. 3 steps stair will count as the same 2-1 and 1-2.

@param n
@returns {number}