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

LCP 06.Coin

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

topic:

screenshot2023-09-21 morning12.12.09.png
topic链接

Thought:

now that4Two times,3也Two times,So it means that this question is nothing more than“As much as possible2indivual2indivual取,Turn count+1”
Although it can be optimized at running time,But I prefer to write a line

Code:

1
2
3
class Solution:
def minCount(self, coins: List[int]) -> int:
return sum(i // 2 + i % 2 for i in coins)
  • Python
  • answer
  • math
  • Array

扫一扫,分享到微信

微信分享二维码
213.Hiccup III
LCP 50.Gem supply
目录
  1. 1. topic:
  2. 2. Thought:
  3. 3. Code:

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