---
# System prepended metadata

title: Week1 (Mar 11)

---

# Week1 (Mar 11)

## 441. Arranging Coins

### Question

You have $n$ coins and you want to build a staircase with these coins. The staircase consists of $k$ rows where the ith row has exactly $i$ coins. The last row of the staircase may be incomplete.

Given the integer $n$, return the number of complete rows of the staircase you will build.

### Hand in homework before Saturday.

:::success
[Andy的作業](https://github.com/appendixisu/leetCode/blob/main/441.Arranging-Coins.swift)
[Allen的作業](https://github.com/allen870619/leetcode_practice/blob/main/1-500/441.%20Arranging%20Coins.playground/Contents.swift)
[xander的作業](https://github.com/Takumi47/30Plus/blob/main/30Plus/Problems/441_ArrangingCoins.swift)
[Roger的作業](https://github.com/GametreeRoger/LeetCode/blob/main/LeetCode441.playground/Contents.swift)
[Wen的作業](https://github.com/Tseng-W/LeetCodePractice/blob/main/LeetCodeStudy.playground/Pages/441.%20Arranging%20Coins.xcplaygroundpage/Contents.swift)
[Will的作業](https://github.com/alangprs/LeetCodePractice/blob/feat/441_arranging_coins/LeetCodePracticeTests/LeetCodePracticeTests.swift)
[Woody的作業](https://github.com/woodycatliu/leetcode/blob/main/441_ArrangingCoins/441.swift)
[Andrew的作業](https://github.com/KrauserHuang/LeetCode/blob/main/LeetCode%20Easy.playground/Pages/441.Arranging-Coins.xcplaygroundpage/Contents.swift)
[Stephen的作業](https://github.com/mirrorsalt667/LeetCodePractice/blob/master/1-500/441-Arranging%20Coins.playground/Contents.swift)
...`Continue filling by yourself`
:::

## 107. Binary Tree Level Order Traversal II

### Question

Given the <mark>$root$</mark> of a binary tree, return the bottom-up level order traversal of its nodes' values. (i.e., from left to right, level by level from leaf to root).

### Hand in homework before Saturday.

:::success
[Allen的作業](https://github.com/allen870619/leetcode_practice/blob/main/1-500/107.%20Binary%20Tree%20Level%20Order%20Traversal%20II.playground/Contents.swift)
[xander的作業](https://github.com/Takumi47/30Plus/blob/main/30Plus/Problems/107_BinaryTreeLevelOrderTraversalII.swift)
[Roger的作業](https://github.com/GametreeRoger/LeetCode/blob/main/LeetCode107.playground/Contents.swift)
[Wen的作業](https://github.com/Tseng-W/LeetCodePractice/blob/main/LeetCodeStudy.playground/Pages/107.%20Binary%20Tree%20Level%20Order%20Traversal%20II.xcplaygroundpage/Contents.swift)
[Woody的作業](https://github.com/woodycatliu/leetcode/blob/main/107_BinaryTree%20LevelOrderTraversal2/107.swift)
[Will的作業](https://github.com/alangprs/LeetCodePractice/blob/feat/107_Binary_Tree_Level_Order_Traversal_II/LeetCodePracticeTests/LeetCodePracticeTests.swift)
...`Continue filling by yourself`
:::

## 957. Prison Cells After N Days

### Question

There are <mark>$8$</mark> prison cells in a row and each cell is either occupied or vacant.

Each day, whether the cell is occupied or vacant changes according to the following rules:

* If a cell has two adjacent neighbors that are both occupied or both vacant, then the cell becomes occupied.
* Otherwise, it becomes vacant.

**Note** that because the prison is a row, the first and the last cells in the row can't have two adjacent neighbors.

You are given an integer array <mark>$cells$</mark> where <mark>$cells[i] == 1$</mark> if the <mark>$i^{th}$</mark> cell is occupied and <mark>$cells[i] == 0$</mark> if the <mark>$i^{th}$</mark> cell is vacant, and you are given an integer <mark>$n$</mark>.

Return the state of the prison after <mark>$n$</mark> days (i.e., <mark>$n$</mark> such changes described above).

### Hand in homework before Saturday.

:::success
[xander的作業](https://github.com/Takumi47/30Plus/blob/main/30Plus/Problems/957_PrisonCellsAfterNDays.swift)
[Allen的作業](https://github.com/allen870619/leetcode_practice/blob/main/501-1000/957.%20Prison%20Cells%20After%20N%20Days.playground/Contents.swift)
[Wen的作業](https://github.com/Tseng-W/LeetCodePractice/blob/main/LeetCodeStudy.playground/Pages/957.%20Prison%20Cells%20After%20N%20Days.xcplaygroundpage/Contents.swift)
[Roger的作業](https://github.com/GametreeRoger/LeetCode/blob/main/LeetCode957.playground/Contents.swift)
[Woody的作業](https://github.com/woodycatliu/leetcode/blob/main/958_PrisonCellsAfterNDays/958.swift)
[Andrew的作業](https://github.com/KrauserHuang/LeetCode/blob/main/LeetCode%20Easy.playground/Pages/957.%20Prison%20Cells%20After%20N%20Days%20🅼.xcplaygroundpage/Contents.swift)
[Stephen的作業](https://github.com/mirrorsalt667/LeetCodePractice/blob/master/501-1000/957-Prison%20Cells%20After%20N%20Days.playground/Contents.swift)
...`Continue filling by yourself`
:::