problem

788. Rotated Digits

solution1:

class Solution {
public:
int rotatedDigits(int N) {
int res = ;
for(int i=; i<=N; ++i)
{
if(check(i)) res++;
}
return res;
}
bool check(int num)
{
string str = to_string(num);
bool flag = false;
for(auto ch:str)
{
if(ch==''||ch==''||ch=='') return false;
if(ch==''||ch==''||ch==''||ch=='') flag = true;
}
return flag;
}
};

参考

1. Leetcode_easy_788. Rotated Digits;

2. Grandyang;

完

【Leetcode_easy】788. Rotated Digits的更多相关文章

  1. 【LeetCode】788. Rotated Digits 解题报告(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.c ...

  2. 【leetcode】1291. Sequential Digits

    题目如下: An integer has sequential digits if and only if each digit in the number is one more than the ...

  3. 【Leetcode_easy】949. Largest Time for Given Digits

    problem 949. Largest Time for Given Digits solution: class Solution { public: string largestTimeFrom ...

  4. LeetCode 788 Rotated Digits 解题报告

    题目要求 X is a good number if after rotating each digit individually by 180 degrees, we get a valid num ...

  5. 【LeetCode】258. Add Digits (2 solutions)

    Add Digits Given a non-negative integer num, repeatedly add all its digits until the result has only ...

  6. 【LeetCode】258. Add Digits

    题目: Given a non-negative integer num, repeatedly add all its digits until the result has only one di ...

  7. 788. Rotated Digits

    X is a good number if after rotating each digit individually by 180 degrees, we get a valid number t ...

  8. #Leetcode# 788. Rotated Digits

    https://leetcode.com/problems/rotated-digits/ X is a good number if after rotating each digit indivi ...

  9. [LeetCode&Python] Problem 788. Rotated Digits

    X is a good number if after rotating each digit individually by 180 degrees, we get a valid number t ...

随机推荐

  1. ES6遍历器 生成器 学习整理

    遍历器[迭代器](Iterator) 就是这样一种机制.它是一种接口,为各种不同的数据结构提供统一的访问机制.任何数据结构只要部署 Iterator 接口,就可以完成遍历操作(即依次处理该数据结构的所 ...

  2. Windows 2012R2安装KB2919355失败

    安装KB2919355时候失败,提示此更新不适用于此计算机. 需要首先安装KB2919442.

  3. splay树 序列终结者

    /* 4655 序列终结者  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 大师 Master 题解       题目描述 Description 网上有许多题,就是给定一个序 ...

  4. 【原创】go语言学习(十)Map类型

    目录 声明和初始化 基本操作 map排序 map类型的切⽚片 课后作业 声明和初始化 1.map类型是⼀一个key-value的数据结构. //var a map[key的类型]value类型 var ...

  5. 新的log4j2.xml

    <?xml version="1.0" encoding="UTF-8"?> <!-- OFF < FATAL < ERROR & ...

  6. 模糊查询(附上源码和jquery-1.12.1.js,jquery-ui.js,jquery-ui.css)

    直接上源码: <!doctype html> <html lang="en"> <head> <meta charset="ut ...

  7. springboot开启gzip压缩

    springboot 2.x开启gzip压缩 1.application.yml配置 server: compression: enabled: true min-response-size: mim ...

  8. Java基础系列 - HashMap

    package com.test3; import java.util.ArrayList; import java.util.HashMap; import java.util.List; impo ...

  9. (转)mysql更改数据目录

    mysql 更改默认数据目录 http://www.cnblogs.com/chenny7/p/3642363.html 本文主要介绍在CentOS下通过yum命令安装MySQL之后,如何移动默认数据 ...

  10. POI2010 Bridges

    好题\(Q\omega Q\) 我们考虑这个东西要求最大值最小,显然一眼二分答案对吧. 问题在于如何\(check\),我们二分答案之后把问题转换成了混合图如何求欧拉回路. 考虑欧拉回路的性质,每一个 ...