Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
網頁
首頁
密碼學
程式設計Programming
APP
計算機概論
herrDeng網內搜尋
自訂搜尋
Ads
2025年2月19日 星期三
C++py3排列組合與binary表達解Leetcode 1415 The k th Lexicographical String of Al...
C++py3排列組合與binary表達解Leetcode 1415 The k th Lexicographical String of All Happy Strings of Length n
總共有3*2^(n-1)個happy strings要求第k個。先算(k-1)除以2^(n-1)的商q與餘數r,s[0]由q決定,s[1:n]由r決定,化r為二進位,然後簡單處理一下就得解
[Py3解請進]
按我讀文 »
2025年2月18日 星期二
C++ Py3 reverse 2pointer解Leetcode 2375 Construct Smallest Number From D...
C++ Py3 reverse 2pointer解Leetcode 2375 Construct Smallest Number From DI String
[codes on Leetcode]
https://leetcode.com/problems/construct-smallest-number-from-di-string/solutions/6435240/suffix-sum-for-successive-ds-c-py3-beats-100/
較新的文章
較舊的文章
首頁
查看行動版
訂閱:
文章 (Atom)
熱門文章