Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.25周报 #169

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/weekly-report-24.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions 刘司晨/week10/周报.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## 八月18日周报
### 一、学习任务
- 完善有关Vue的知识
- 开始准备小兔鲜的项目
### 二、力扣刷题
- 第一题:给你一个数组 candies 和一个整数 extraCandies ,其中 candies[i] 代表第 i 个孩子拥有的糖果数目。

对每一个孩子,检查是否存在一种方案,将额外的 extraCandies 个糖果分配给孩子们之后,此孩子有 最多 的糖果。注意,允许有多个孩子同时拥有 最多 的糖果数目。

题解:class Solution {
public List<Boolean> kidsWithCandies(int[] candies, int extraCandies) {
int n = candies.length;
int maxCandies = 0;
for (int i = 0; i < n; ++i) {
maxCandies = Math.max(maxCandies, candies[i]);
}
List<Boolean> ret = new ArrayList<Boolean>();
for (int i = 0; i < n; ++i) {
ret.add(candies[i] + extraCandies >= maxCandies);
}
return ret;
}
}

- 第二题:给你一个数组 nums 。数组「动态和」的计算公式为:runningSum[i] = sum(nums[0]…nums[i]) 。

请返回 nums 的动态和。
题解:class Solution {
public int[] runningSum(int[] nums) {
int n = nums.length;
for(int i=1;i<n;i++){
nums[i]+=nums[i-1];
}
return nums;
}
}
17 changes: 17 additions & 0 deletions 刘司晨/week11/周报.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 8.25 周报

## 一、学习内容

1. 完成小兔鲜项目(因为上周外出比赛和这周考驾照耽搁了几天,项目完成的有些仓促)
2.仓库网址:https://github.com/owensichen/xiaotuxian
## 二、小兔鲜开发感受

1. 开发项目前,了解了项目开发的前期准备可以有效地提升开发效率
2. 提前做好结构构造,避免后期会混乱
3. 熟悉模块与模块之间的配合,以及将各个复杂功能拆分成一步步的小功能来实现
4. 渲染类型组件的通用写法:写接口-调用接口获取数据-传入
5. 多查阅官方文档,了解第三方组件
6. 后续开发中要提升关于HTML、CSS的运用
7. vue3与vue2最大的区别,就是组合式API的使用,它相比于vue2来说让代码量变的少了
8. setup这个语法糖,可以省略return这一步,更利于后期的一个维护和代码编写
9. 小兔鲜这个项目让我熟悉了Composition API这种编写代码的逻辑以及一个电商网站的基本逻辑,以及如何使用Pinia来管理应用状态,路由,axios
54 changes: 54 additions & 0 deletions 刘司晨/week9/周报.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## 第九周周报

# 一、学习任务

1. 复习了一下关于JS进阶的有关内容
2. 学习了vue3的基础和进阶内容(但是还没学完)
3. 继续leetcode刷题

# 二、力扣刷题

1. 小红和小明在玩一个字符串元音游戏。
给你一个字符串 s,小红和小明将轮流参与游戏,小红 先 开始:
- 在小红的回合,她必须移除 s 中包含 奇数 个元音的任意 非空 子字符串。
- 在小明的回合,他必须移除 s 中包含 偶数 个元音的任意 非空 子字符串。
第一个无法在其回合内进行移除操作的玩家输掉游戏。假设小红和小明都采取 最优策略 。
如果小红赢得游戏,返回 true,否则返回 false。
英文元音字母包括:a, e, i, o, 和 u。
题解:
class Solution {
public boolean doesAliceWin(String s) {
for(char c:s.toCharArray()){
if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'){
return true;
}
}
return false;
}
}
2. 给你一个
二进制字符串
s。

你可以对这个字符串执行 任意次 下述操作:

选择字符串中的任一下标 i( i + 1 < s.length ),该下标满足 s[i] == '1' 且 s[i + 1] == '0'。
将字符 s[i] 向 右移 直到它到达字符串的末端或另一个 '1'。例如,对于 s = "010010",如果我们选择 i = 1,结果字符串将会是 s = "000110"。
返回你能执行的 最大 操作次数。

题解:
class Solution {
public int maxOperations(String s) {
char[] a = s.toCharArray();
int ans = 0;
int cnt1 = 0;
for(int i=0;i<a.length;i++){
if(a[i]=='1'){
cnt1++;
}else if(i>0&&a[i-1]=='1'){
ans+=cnt1;
}
}
return ans;
}
}
Loading