【题目】

  • 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. 广度优先搜索(BFS)

    定义 维基百科:https://en.wikipedia.org/wiki/Breadth-first_search 给定图G=(V,E)和一个可识别的源结点s,广度优先搜索对图G中的边进行系统性的探 ...

  2. qt creator 使用Ui文件的问题

    一.显式地调用uic.exe 如何将UI文件生成头文件 1,将设计的UI文件拷贝到uic.exe的目录下Qt\Qt5.3.2\5.3\mingw482_32\bin. 2, 打开windows的CMD ...

  3. Cheatsheet: 2016 07.01 ~ 07.31

    Mobile What to Expect From Swift 3 Web A practical security guide for web developers Gulp Succinctly ...

  4. js压缩图片base64长度

    var myCanvas=$('.img-container > img').cropper('getCroppedCanvas'); (function (base64){ var image ...

  5. pinpoint 安装部署

    .markdown-preview:not([data-use-github-style]) { padding: 2em; font-size: 1.2em; color: rgb(171, 178 ...

  6. 蒙特卡洛马尔科夫链(MCMC)

    蒙特卡洛马尔科夫链(MCMC) 标签: 机器学习重要性采样MCMC蒙特卡洛 2016-12-30 20:34 3299人阅读 评论(0) 收藏 举报  分类: 数据挖掘与机器学习(41)  版权声明: ...

  7. Java分别与MySQL、Oracle、SQL Server数据库建立连接

    1.与MySQL连接 jar包下载地址: Class.forName("com.mysql.jdbc.Driver");//加载数据库驱动(MySQL的jar包) String u ...

  8. 参考__MySql

    博客 三范式 事务隔离级别 列表

  9. Android 自定义Adapter 但listview 只显示第一条数据

    <ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content ...

  10. ssh框架的工作原理

    struts2的工作原理 1 客户端初始化一个指向Servlet容器(例如Tomcat)的请求 2 这个请求经过一系列的过滤器(Filter)(这些过滤器中有一个叫做ActionContextClea ...