avatar
Siz Long

My name is Siz. I am a computer science graduate student specializing in backend development with Golang and Python, seeking opportunities in innovative tech projects. My personal website is me.longsizhuo.com .Connect with me on LinkedIn: https://www.linkedin.com/in/longsizhuo/.

  • Resume
  • Archives
  • Categories
  • Photos
  • Music



{{ date }}

{{ time }}

avatar
Siz Long

My name is Siz. I am a computer science graduate student specializing in backend development with Golang and Python, seeking opportunities in innovative tech projects. My personal website is me.longsizhuo.com .Connect with me on LinkedIn: https://www.linkedin.com/in/longsizhuo/.

  • 主页
  • Resume
  • Archives
  • Categories
  • Photos
  • Music

One question daily 2283

  2024-01-01        
字数统计: 106字   |   阅读时长: 1min

2283.Determine whether the number of a number is equal to the value of the digital position。

1
2
3
4
5
6
7
8
9
10
class Solution:
def digitCount(self, num: str) -> bool:
hash_1 = {}
for index, i in enumerate(num):
if int(i) != 0:
hash_1[str(index)] = int(i)
hash_2 = Counter(num)
if hash_1 == dict(hash_2):
return True
return False

I read this question for a while,MeaningindexRead,indexAppearnum[index]Second-rate,1210that is”0Appear1Second-rate,”1Appear2Second-rate,”2Appear1Second-rate,”3Appear0Second-rate。ThennumJust count the things in。

Because I was doing the practice of hash table two days ago,So at a glance at this question,Use directlyCounterFunction counts,Compare,Finish

  • Python
  • solved,answer

扫一扫,分享到微信

微信分享二维码
221Maximum square
One question daily 2293. Great mini game
目录
ahoh, this article has no catalog.

150 篇 | 131.7k
次 | 人
这里自动载入天数这里自动载入时分秒
2022-2025 loong loong | 新南威尔士龙龙号