diff --git a/solution/1100-1199/1185.Day of the Week/README.md b/solution/1100-1199/1185.Day of the Week/README.md
index 94c3068a65c99..ed442e29e42ac 100644
--- a/solution/1100-1199/1185.Day of the Week/README.md
+++ b/solution/1100-1199/1185.Day of the Week/README.md
@@ -44,18 +44,26 @@
-直接调库或者应用蔡勒公式。
+**方法一:蔡勒公式**
-
+我们可以使用蔡勒公式来计算星期几,蔡勒公式如下:
+
+$$
+w = (\left \lfloor \frac{c}{4} \right \rfloor - 2c + y + \left \lfloor \frac{y}{4} \right \rfloor + \left \lfloor \frac{13(m+1)}{5} \right \rfloor + d - 1) \bmod 7
+$$
+
+其中:
- `w`: 星期(从 Sunday 开始)
- `c`: 年份前两位
- `y`: 年份后两位
- `m`: 月(m 的取值范围是 3 至 14,即在蔡勒公式中,某年的 1、2 月要看作上一年的 13、14 月来计算,比如 2003 年 1 月 1 日要看作 2002 年的 13 月 1 日来计算)
- `d`: 日
-- `[ ]`: 向下取整
+- `⌊⌋`: 向下取整
- `mod`: 取余
+时间复杂度 $O(1)$,空间复杂度 $O(1)$。
+
### **Python3**
@@ -158,6 +166,30 @@ func dayOfTheWeek(d int, m int, y int) string {
}
```
+### **TypeScript**
+
+```ts
+function dayOfTheWeek(d: number, m: number, y: number): string {
+ if (m < 3) {
+ m += 12;
+ y -= 1;
+ }
+ const c: number = (y / 100) | 0;
+ y %= 100;
+ const w = (((c / 4) | 0) - 2 * c + y + ((y / 4) | 0) + (((13 * (m + 1)) / 5) | 0) + d - 1) % 7;
+ const weeks: string[] = [
+ 'Sunday',
+ 'Monday',
+ 'Tuesday',
+ 'Wednesday',
+ 'Thursday',
+ 'Friday',
+ 'Saturday',
+ ];
+ return weeks[(w + 7) % 7];
+}
+```
+
### **...**
```
diff --git a/solution/1100-1199/1185.Day of the Week/README_EN.md b/solution/1100-1199/1185.Day of the Week/README_EN.md
index 61300055289cd..d5044521cc98e 100644
--- a/solution/1100-1199/1185.Day of the Week/README_EN.md
+++ b/solution/1100-1199/1185.Day of the Week/README_EN.md
@@ -41,9 +41,25 @@
## Solutions
-Zeller formula.
+**Solution 1: Zeller's Congruence**
-
+We can use Zeller's Congruence to calculate the day of the week. Zeller's Congruence is as follows:
+
+$$
+w = (\left \lfloor \frac{c}{4} \right \rfloor - 2c + y + \left \lfloor \frac{y}{4} \right \rfloor + \left \lfloor \frac{13(m+1)}{5} \right \rfloor + d - 1) \bmod 7
+$$
+
+Where:
+
+- `w`: Day of the week (starting from Sunday)
+- `c`: First two digits of the year
+- `y`: Last two digits of the year
+- `m`: Month (the range of m is from 3 to 14, that is, in Zeller's Congruence, January and February of a certain year are considered as the 13th and 14th month of the previous year. For example, January 1, 2003 is considered as the 1st day of the 13th month of 2002)
+- `d`: Day
+- `⌊⌋`: Floor function (round down)
+- `mod`: Modulo operation
+
+The time complexity is $O(1)$, and the space complexity is $O(1)$.
@@ -143,6 +159,30 @@ func dayOfTheWeek(d int, m int, y int) string {
}
```
+### **TypeScript**
+
+```ts
+function dayOfTheWeek(d: number, m: number, y: number): string {
+ if (m < 3) {
+ m += 12;
+ y -= 1;
+ }
+ const c: number = (y / 100) | 0;
+ y %= 100;
+ const w = (((c / 4) | 0) - 2 * c + y + ((y / 4) | 0) + (((13 * (m + 1)) / 5) | 0) + d - 1) % 7;
+ const weeks: string[] = [
+ 'Sunday',
+ 'Monday',
+ 'Tuesday',
+ 'Wednesday',
+ 'Thursday',
+ 'Friday',
+ 'Saturday',
+ ];
+ return weeks[(w + 7) % 7];
+}
+```
+
### **...**
```
diff --git a/solution/1100-1199/1185.Day of the Week/Solution.ts b/solution/1100-1199/1185.Day of the Week/Solution.ts
new file mode 100644
index 0000000000000..12ef4a4341433
--- /dev/null
+++ b/solution/1100-1199/1185.Day of the Week/Solution.ts
@@ -0,0 +1,19 @@
+function dayOfTheWeek(d: number, m: number, y: number): string {
+ if (m < 3) {
+ m += 12;
+ y -= 1;
+ }
+ const c: number = (y / 100) | 0;
+ y %= 100;
+ const w = (((c / 4) | 0) - 2 * c + y + ((y / 4) | 0) + (((13 * (m + 1)) / 5) | 0) + d - 1) % 7;
+ const weeks: string[] = [
+ 'Sunday',
+ 'Monday',
+ 'Tuesday',
+ 'Wednesday',
+ 'Thursday',
+ 'Friday',
+ 'Saturday',
+ ];
+ return weeks[(w + 7) % 7];
+}