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

text2 #111

Merged
merged 30 commits into from
Jan 4, 2024
Merged

text2 #111

merged 30 commits into from
Jan 4, 2024

Conversation

KL2333
Copy link

@KL2333 KL2333 commented Dec 3, 2023

No description provided.

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 107
  • Correct answers: 25
  • Score: 23.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 107
  • Correct answers: 48
  • Score: 44.00%

27感觉BC都可以呀??
@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 107
  • Correct answers: 48
  • Score: 44.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 107
  • Correct answers: 49
  • Score: 45.00%

@iphysresearch
Copy link
Owner

Bug 已经解决,现在题目总数可以识别为正确的108了哈

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 89
  • Score: 82.00%

@KL2333
Copy link
Author

KL2333 commented Dec 4, 2023

错好多....

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 51
  • Score: 47.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 82
  • Score: 75.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 82
  • Score: 75.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 98
  • Score: 90.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 106
  • Score: 98.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 106
  • Score: 98.00%

Numpy homework:

  • Total questions: 10
  • Correct answers: 9
  • Score: 90.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 106
  • Score: 98.00%

Numpy homework:

  • Total questions: 10
  • Correct answers: 10
  • Score: 100.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 106
  • Score: 98.00%

Numpy homework:

  • Total questions: 10
  • Correct answers: 10
  • Score: 100.00%

Pandas homework:

  • Total questions: 12
  • Correct answers: 9
  • Score: 75.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 106
  • Score: 98.00%

Numpy homework:

  • Total questions: 10
  • Correct answers: 10
  • Score: 100.00%

Pandas homework:

  • Total questions: 12
  • Correct answers: 9
  • Score: 75.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 106
  • Score: 98.00%

Numpy homework:

  • Total questions: 10
  • Correct answers: 10
  • Score: 100.00%

Pandas homework:

  • Total questions: 12
  • Correct answers: 10
  • Score: 83.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 106
  • Score: 98.00%

Numpy homework:

  • Total questions: 10
  • Correct answers: 10
  • Score: 100.00%

Pandas homework:

  • Total questions: 12
  • Correct answers: 9
  • Score: 75.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 106
  • Score: 98.00%

Numpy homework:

  • Total questions: 10
  • Correct answers: 10
  • Score: 100.00%

Pandas homework:

  • Total questions: 12
  • Correct answers: 9
  • Score: 75.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 106
  • Score: 98.00%

Numpy homework:

  • Total questions: 10
  • Correct answers: 10
  • Score: 100.00%

Pandas homework:

  • Total questions: 12
  • Correct answers: 9
  • Score: 75.00%

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 106
  • Score: 98.00%

Numpy homework:

  • Total questions: 10
  • Correct answers: 10
  • Score: 100.00%

Pandas homework:

  • Total questions: 12
  • Correct answers: 11
  • Score: 91.00%

@KL2333 KL2333 closed this Dec 9, 2023
@KL2333 KL2333 reopened this Dec 9, 2023
@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

1 similar comment
@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

@KL2333
Copy link
Author

KL2333 commented Dec 9, 2023

[434. Number of Segments in a String](https://leetcode.com/problems/number-of-segments-in-a-string/)

class Solution:
    def countSegments(self, s: str) -> int:
        s=s.strip()				# 清理空格
        count=0					# 计数器初始化
        c_ount=0
        if len(s)==0:			# 特殊情况
            return 0
        for char in s:			# 循环遍历
            if char != ' ':		# 空格计数器reset情况
                c_ount =0 
                continue		# 同时跳出本次循环
            c_ount+=1			# 空格计数器+1
            if c_ount==1:		# 对连续和普通空格均仅计数一次
                count+=1
        return count+1          # 空格计数器计数+1为段数       

[1869. Longer Contiguous Segments of Ones than Zeros](https://leetcode.com/problems/longer-contiguous-segments-of-ones-than-zeros/description/)

class Solution:
    def checkZeroOnes(self, s: str) -> bool:
        a=s.split('0')				# 对s按0分段
        b=s.split('1')				# 对s按1分段
        m1=max(len(c) for c in a)	# 最长的1的长度
        m2=max(len(c) for c in b)	# 最长的0的长度
        return m1>m2				# 返回两者最长长度的比较

[1784. Check if Binary String Has at Most One Segment of Ones](https://leetcode.com/problems/check-if-binary-string-has-at-most-one-segment-of-ones/description/)

class Solution:
    def checkOnesSegment(self, s: str) -> bool:
        if len(s)==1:				# 特殊情况
            return 1				
        s=s.rstrip('0')				# 清理末尾的'0'
        if len(s.split('0'))==1:	# 按'0'分割,段数为1即满足要求
            return 1				
        else :						
            return 0				# 其它类型

[852. Peak Index in a Mountain Array](https://leetcode.com/problems/peak-index-in-a-mountain-array/description/)

class Solution:
    def peakIndexInMountainArray(self, arr: List[int]) -> int:
        return arr.index(max(arr))	# 返回峰值的index

[162. Find Peak Element](https://leetcode.com/problems/find-peak-element/description/)

class Solution:
    def findPeakElement(self, nums: List[int]) -> int:
        if len(nums)<3:										# 特殊情况短的直接判断
            return nums.index(max(nums))
        nums.insert(0,float('-inf'))						# 前后插入负无穷辅助判断两端点
        nums.append(float('-inf'))
        for i in range(0,len(nums)-1):						# 判断相邻三个的大小是否为峰型,由于之前在list前插入了元素,此时的index均要-1
            if nums[i]<nums[i+1] and nums[i+1]>nums[i+2]:
                return i

@KL2333
Copy link
Author

KL2333 commented Dec 9, 2023

愚钝如我,暂时放弃

@KL2333
Copy link
Author

KL2333 commented Dec 9, 2023

@iphysresearch 可以记录了

@iphysresearch
Copy link
Owner

iphysresearch commented Dec 10, 2023

愚钝如我,暂时放弃

@KL2333
你要不再试试?显示不出来成绩往往是因为我这里的homework分支有更新的一次提交,需要你在自己的仓库homework分支上进行update branch,不然的话,你的commit 里会有不唯一的作业文件修改,就会让判作业工作流报错的。

也有同学遇到类型的情况:#137 (comment)

另外,答案可以互相抄哈。。。只要你找得到哈

@iphysresearch
Copy link
Owner

Good Job!!! @KL2333

Python homework:

  • Total questions: 108
  • Correct answers: 106
  • Score: 98.00%

Numpy homework:

  • Total questions: 10
  • Correct answers: 10
  • Score: 100.00%

Pandas homework:

  • Total questions: 12
  • Correct answers: 11
  • Score: 91.00%

@iphysresearch iphysresearch merged commit 747b74b into iphysresearch:homework Jan 4, 2024
5 checks passed
@iphysresearch
Copy link
Owner

@KL2333

完成Python扩展作业!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants