Skip to content

Commit

Permalink
update progress
Browse files Browse the repository at this point in the history
  • Loading branch information
yennanliu committed Nov 19, 2024
1 parent d2771b5 commit 2fcf6a5
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 27 deletions.
4 changes: 4 additions & 0 deletions data/progress.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Progress

# 2024-11-17
- https://github.com/wisdompeak/LeetCode/tree/master?tab=readme-ov-file#two-pointers
- (Two pointers for two sequences)

# 2024-11-17
- https://github.com/yennanliu/CS_basics/blob/master/doc/Leetcode_company_frequency-master/Google%206months-%20LeetCode.pdf

Expand Down
2 changes: 1 addition & 1 deletion data/progress.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
20241120: 986,80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)
20241117: 394
20241116: 833,950
20241114: 80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)
20241110: 53,210,207
20241109: 444
20241108: 1188,130,855(again)
Expand Down
29 changes: 16 additions & 13 deletions data/to_review.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
2025-01-14 -> ['986,80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)']
2025-01-11 -> ['394']
2025-01-10 -> ['833,950']
2025-01-08 -> ['80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)']
2025-01-04 -> ['53,210,207']
2025-01-03 -> ['444']
2025-01-02 -> ['1188,130,855(again)']
2024-12-28 -> ['900']
2024-12-27 -> ['26,27', '802,1197,26']
2024-12-24 -> ['986,80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)']
2024-12-21 -> ['394', '855,846']
2024-12-20 -> ['833,950', '932']
2024-12-18 -> ['80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)', '951,792']
2024-12-18 -> ['951,792']
2024-12-14 -> ['53,210,207', '163,1048']
2024-12-13 -> ['444', '298,729']
2024-12-12 -> ['1188,130,855(again)', '1146']
2024-12-11 -> ['986,80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)']
2024-12-08 -> ['394', '737']
2024-12-07 -> ['833,950', '900', '686,734,737']
2024-12-06 -> ['26,27', '802,1197,26', '353']
2024-12-05 -> ['80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)', '528,334']
2024-12-03 -> ['1145']
2024-12-05 -> ['528,334']
2024-12-03 -> ['986,80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)', '1145']
2024-12-01 -> ['53,210,207']
2024-11-30 -> ['394', '444', '855,846', '1145,1219']
2024-11-29 -> ['833,950', '1188,130,855(again)', '932']
2024-11-27 -> ['80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)', '951,792', '524,221,889']
2024-11-28 -> ['986,80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)']
2024-11-27 -> ['951,792', '524,221,889']
2024-11-26 -> ['743,889']
2024-11-25 -> ['394', '837']
2024-11-25 -> ['986,80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)', '394', '837']
2024-11-24 -> ['833,950', '900']
2024-11-23 -> ['53,210,207', '26,27', '802,1197,26', '163,1048', '981']
2024-11-22 -> ['394', '80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)', '444', '298,729', '1087']
2024-11-21 -> ['833,950', '1188,130,855(again)', '1146']
2024-11-23 -> ['986,80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)', '53,210,207', '26,27', '802,1197,26', '163,1048', '981']
2024-11-22 -> ['986,80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)', '394', '444', '298,729', '1087']
2024-11-21 -> ['986,80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)', '833,950', '1188,130,855(again)', '1146']
2024-11-20 -> ['394', '939']
2024-11-19 -> ['394', '833,950', '80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)']
2024-11-19 -> ['394', '833,950']
2024-11-18 -> ['394', '833,950', '53,210,207', '430']
2024-11-17 -> ['833,950', '80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)', '444', '855,846', '737', '363']
2024-11-16 -> ['80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)', '1188,130,855(again)', '900', '932', '686,734,737', '1032,844,1011']
2024-11-15 -> ['80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)', '53,210,207', '26,27', '802,1197,26', '353', '947']
2024-11-17 -> ['833,950', '444', '855,846', '737', '363']
2024-11-16 -> ['1188,130,855(again)', '900', '932', '686,734,737', '1032,844,1011']
2024-11-15 -> ['53,210,207', '26,27', '802,1197,26', '353', '947']
2024-11-14 -> ['444', '951,792', '528,334']
2024-11-13 -> ['53,210,207', '1188,130,855(again)']
2024-11-12 -> ['53,210,207', '444', '1145', '753']
Expand Down
72 changes: 59 additions & 13 deletions leetcode_java/src/main/java/dev/workspace5.java
Original file line number Diff line number Diff line change
Expand Up @@ -2088,7 +2088,7 @@ public int[] beautifulArray(int n) {

// LC 855
// https://leetcode.com/problems/exam-room/
// 4.28 pm - 4.40 pm
// 6.53 - 7.15 am
/**
* ep 1:
*
Expand All @@ -2112,33 +2112,79 @@ public int[] beautifulArray(int n) {
*
*/
class ExamRoom {
// attr

int[] seats;
PriorityQueue<Integer> pq;
int seated;

public ExamRoom(int n) {
this.seats = new int[n];
this.pq = new PriorityQueue();
seats = new int[n]; // init val ??
seated = 0;
}

public int seat() {
// if not one seated, select the 0 idx seat
if (this.pq.isEmpty()){
this.seats[0] = 0;
//return 0;
if (seated == 0){
seats[0] = 1;
seated += 1;
return 0;
}

// TODO : fix
return 0;
// get "to compare" seat
int idx = -1;
for (int j = 0; j < seats.length; j++){
// get distance
//int dis = 1;
if (seats[j] == 0){
idx = j;
break;
}
}

int toPutIdx = -1;
// find "maximizes the distance to the closest person"
for (int i = seats.length; i > 0; i--){
if (seats[i] != 0){
toPutIdx = i;
break;
}
}
return toPutIdx; // ???
}

public void leave(int p) {

this.seats[p] = 0;
seats[p] = 0;
seated -= 1;
}

}

// class ExamRoom {
// // attr
// int[] seats;
// PriorityQueue<Integer> pq;
//
// public ExamRoom(int n) {
// this.seats = new int[n];
// this.pq = new PriorityQueue();
// }
//
// public int seat() {
// // if not one seated, select the 0 idx seat
// if (this.pq.isEmpty()){
// this.seats[0] = 0;
// return 0;
// }
//
// // TODO : fix
// return 0;
// }
//
// public void leave(int p) {
//
// this.seats[p] = 0;
// }
//
// }

// LC 846
// https://leetcode.com/problems/hand-of-straights/
// 5.29 pm - 5.45 pm
Expand Down

0 comments on commit 2fcf6a5

Please sign in to comment.