Redtongue

人生苦短,我用Python


  • 首页

  • 归档

  • 分类

  • 标签

  • 关于

  • 搜索

869.Reordered Power of 2

发表于 2018-07-16 | 更新于: 2018-11-07 | 分类于 leetcode

Description

Starting with a positive integer N, we reorder the digits in any order (including the original order) such that the leading digit is not zero.

Return true if and only if we can do this in a way such that the resulting number is a power of 2.

题目链接:https://leetcode.com/problems/reordered-power-of-2/

Difficulty: medium

阅读全文 »

868.Binary Gap

发表于 2018-07-16 | 更新于: 2018-11-07 | 分类于 leetcode

Description

Given a positive integer N, find and return the longest distance between two consecutive 1’s in the binary representation of N.

If there aren’t two consecutive 1’s, return 0.

题目链接:https://leetcode.com/problems/binary-gap/

Difficulty: easy

阅读全文 »
1…2021
yunxiang wang

yunxiang wang

记录点点

202 日志
4 分类
41 标签
GitHub E-Mail
© 2016 — 2020 yunxiang wang