【题目】

  • Total Accepted: 10330
  • Total Submissions: 24061
  • Difficulty: Easy
  • Contributors: Admin

A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59).

Each LED represents a zero or one, with the least significant bit on the right.

For example, the above binary watch reads "3:25".

Given a non-negative integer n which represents the number of LEDs that are currently on, return all possible times the watch could represent.

Example:

Input: n = 1
Return: ["1:00", "2:00", "4:00", "8:00", "0:01", "0:02", "0:04", "0:08", "0:16", "0:32"]

Note:

  • The order of output does not matter.
  • The hour must not contain a leading zero, for example "01:00" is not valid, it should be "1:00".
  • The minute must be consist of two digits and may contain a leading zero, for example "10:2" is not valid, it should be "10:02".

【解答】

【2016/10/31】考察combination,复习了backtracking的内容,但还是没写出来。。。

401. Binary Watch的更多相关文章

  1. 27. leetcode 401. Binary Watch

    A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom ...

  2. [LeetCode&Python] Problem 401. Binary Watch

    A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom ...

  3. 401. Binary Watch 回溯

    A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom ...

  4. [LeetCode] 401. Binary Watch 二进制表

    A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom ...

  5. 【LeetCode】401. Binary Watch 解题报告(Java & Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 java解法 Python解法 日期 [LeetCo ...

  6. [leetcode] 401. Binary Watch

    https://leetcode.com/contest/5/problems/binary-watch/ 这个题应该是这次最水的,这个题目就是二进制,然后是10位,最大1024,然后遍历,找二进制里 ...

  7. 401 Binary Watch 二进制手表

    详见:https://leetcode.com/problems/binary-watch/description/ C++: class Solution { public: vector<s ...

  8. LeetCode_401. Binary Watch

    401. Binary Watch Easy A binary watch has 4 LEDs on the top which represent the hours (0-11), and th ...

  9. LeetCode All in One 题目讲解汇总(持续更新中...)

    终于将LeetCode的免费题刷完了,真是漫长的第一遍啊,估计很多题都忘的差不多了,这次开个题目汇总贴,并附上每道题目的解题连接,方便之后查阅吧~ 477 Total Hamming Distance ...

随机推荐

  1. VirtualBox piix4_smbus Error

    VirtualBox piix4_smbus Error   VirtualBox 3.2.10 gives me the following error message when booting U ...

  2. 转行做开发的Wiki:找好方向

    案 我是一个从建筑行业转行过来的后端工程师,转行来写代码了.最近发现经常有同学和网上的朋友问我一些转行的问题,零零散散地回答莫不如写一篇文章,以后回答此类问题就方便多了. 我的专业是给排水,属于非常传 ...

  3. git stuff

    git stuff trick git bash 无法标记复制解决办法 git bash窗口左上角图标点击,选择属性->选项->快速编辑模式 确定就ok了 Usual Commands 创 ...

  4. 《爵迹》侵权链接多为个人用户分享到个人网盘 总结说明:推广途径为 网盘>微博>博客>贴吧>知道

    网络侵权链接3318条.该片的侵权范围分布相对较均匀,其中微博/博客侵权链接630条.占比19%:贴吧778条.占比23.4%:知道513条.占比15.4%:网盘828条.占比25%:小网站410条. ...

  5. Java小游戏贪吃蛇

    package snake; import java.awt.BorderLayout;import java.awt.Canvas;import java.awt.Color;import java ...

  6. netperf安装及使用

    一.简介 Netperf是由惠普公司开发的,测试网络栈.即测试不同类型的网络性能的benchmark工具,大多数网络类型TCP/UPD端对端的性能,得到网络上不同类型流量的性能参数.Netperf根据 ...

  7. python3 实现简单信用卡管理程序

    1.程序执行代码: #Author by Andy #_*_ coding:utf-8 _*_ import os,sys,time Base_dir=os.path.dirname(os.path. ...

  8. ThinkPHP3.2.3使用cli命令行模式

    使用tp3.2.3的cli模式时,报错.加上绝对路径还是报错.所以采用普通模式 if(version_compare(PHP_VERSION,'5.3.0','<')) die('require ...

  9. DOM操作方法的简单归纳

    (1)要在每个匹配的元素中插入新元素,使用: .append() .appendTo()   .prepend() .prependTo() (2)要在每个匹配的元素相邻的位置上插入新元素,使用: . ...

  10. 媒体查询使用方法@media

    Media Queries能在不同的条件下使用不同的样式,使页面在不同在终端设备下达到不同的渲染效果.前面简单的介绍了Media Queries如何引用到项目中,但Media Queries有其自己的 ...