How to find the Kth bit in the Nth binary string on LeetCode 1545?

2026-06-10 03:570阅读0评论SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计453个文字,预计阅读时间需要2分钟。

How to find the Kth bit in the Nth binary string on LeetCode 1545?

给定两个正整数 n 和 k,二进制字符串 Sn 是按以下方式形成的:S1=0,Si=Si-1 + 1 + reverse(invert(Si-1)),其中 + 表示连接操作,reverse(x) 返回字符串 x 的反转,invert(x) 返回字符串 x 的反转后的每个字符取反。

阅读全文

本文共计453个文字,预计阅读时间需要2分钟。

How to find the Kth bit in the Nth binary string on LeetCode 1545?

给定两个正整数 n 和 k,二进制字符串 Sn 是按以下方式形成的:S1=0,Si=Si-1 + 1 + reverse(invert(Si-1)),其中 + 表示连接操作,reverse(x) 返回字符串 x 的反转,invert(x) 返回字符串 x 的反转后的每个字符取反。

阅读全文