【Leetcode_easy】788. Rotated Digits
problem
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的更多相关文章
- 【LeetCode】788. Rotated Digits 解题报告(Python)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.c ...
- 【leetcode】1291. Sequential Digits
题目如下: An integer has sequential digits if and only if each digit in the number is one more than the ...
- 【Leetcode_easy】949. Largest Time for Given Digits
problem 949. Largest Time for Given Digits solution: class Solution { public: string largestTimeFrom ...
- LeetCode 788 Rotated Digits 解题报告
题目要求 X is a good number if after rotating each digit individually by 180 degrees, we get a valid num ...
- 【LeetCode】258. Add Digits (2 solutions)
Add Digits Given a non-negative integer num, repeatedly add all its digits until the result has only ...
- 【LeetCode】258. Add Digits
题目: Given a non-negative integer num, repeatedly add all its digits until the result has only one di ...
- 788. Rotated Digits
X is a good number if after rotating each digit individually by 180 degrees, we get a valid number t ...
- #Leetcode# 788. Rotated Digits
https://leetcode.com/problems/rotated-digits/ X is a good number if after rotating each digit indivi ...
- [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 ...
随机推荐
- 文件读写(一)利用File静态类 System.IO.FileInfo、DirectoryInfo、DriveInfo
提供用于创建.复制.删除.移动和打开单一文件的静态方法,并协助创建 FileStream 对象. 一.读文件: 1.返回字符串:File.ReadAllText() string readText = ...
- 51nod 1577 异或凑数 线性基的妙用
\(OTZgengyf\)..当场被吊打\(QwQ\) 思路:线性基 提交:\(3\)次 错因:往里面加数时\(tmp.p\)与\(i\)区分不清(还是我太菜了) 题解: 我们对每个位置的线性基如此操 ...
- IntelliJ IDEA——数据库集成工具(Database)的使用
https://www.cnblogs.com/huiyi0521/p/10125537.html idea集成了一个数据库管理工具,可以可视化管理很多种类的数据库,意外的十分方便又好用.这里以ora ...
- sql server 存储过程---游标的循环
sqlserver中的循环遍历(普通循环和游标循环) sql 经常用到循环,下面介绍一下普通循环和游标循环 1.首先需要一个测试表数据Student
- sql server 存储过程 output 和return的使用 方法,详解
SQL Server目前正日益成为WindowNT操作系统上面最为重要的一种数据库管理系统,随着 SQL Server2000的推出,微软的这种数据库服务系统真正地实现了在WindowsNT/2000 ...
- bootstrap Table 的使用方法
然后添加css 找到bootstrap-table.min.css 添加进去 再添加JS Js添加时 按照顺序添加 然后初始化bootstrap-table <script type=&qu ...
- LOJ P10147 石子合并 题解
Analysis 区间dp+前缀和 #include<iostream> #include<cstdio> #include<cstring> #include&l ...
- MongoDB 集合与文档操作
一.创建DB 1.查看DB >show dbs 2.创建DB >use mydb 3.查看当前DB >db 4.删除DB >use mydb >db.dropDataba ...
- CF620E New Year Tree 线段树+dfs序+bitset
线段树维护 dfs 序是显然的. 暴力建 60 个线段树太慢,于是用 bitset 优化就好了 ~ code: #include <bits/stdc++.h> #define M 63 ...
- chrome的内存限制
推荐阅读:https://www.cnblogs.com/chengxs/p/10919311.html chrome内存限制 存在限制 Chrome限制了所能使用的内存极限(64位为1.4GB,32 ...