【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 ...
随机推荐
- Prometheus+Grafana监控
什么是Prometheus? Prometheus是由SoundCloud开发的开源监控报警系统和时序列数据库(TSDB).Prometheus使用Go语言开发,是Google BorgMon监控系统 ...
- Spring Cloud Eureka 注册中心高可用机制
一.Eureka 正常工作流程 Service 服务作为 Eureka Client 客户端需要在启动的时候就要向 Eureka Server 注册中心进行注册,并获取最新的服务列表数据. Eurek ...
- javascript动态合并表格相同的单元格
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Conten ...
- PHP读取文件内容的方法
下面我们就为大家详细介绍PHP读取文件内容的两种方法. 第一种方法:fread函数 <?php $file=fopen('1.txt','rb+'); echo fread($file,file ...
- xhEditor编辑器从word粘贴公式
我司需要做一个需求,就是使用富文本编辑器时,不要以上传附件的形式上传图片,而是以复制粘贴的形式上传图片. 在网上找了一下,有一个插件支持这个功能. WordPaster 安装方式如下: 直接使用Wor ...
- 爬虫(四):BeautifulSoup库的使用
一:beautifulsoup简介 beautifulsoup是一个非常强大的工具,爬虫利器. beautifulSoup “美味的汤,绿色的浓汤” 一个灵活又方便的网页解析库,处理高效,支持多种解析 ...
- linux系列(十四):head命令
1.命令格式: head [参数] [文件] 2.命令功能: head 用来显示档案的开头至标准输出中,默认head命令打印其相应文件的开头10行. 3.命令参数: -q 隐藏文件名 -v 显示文件名 ...
- Linux中的MySQL授权远程连接
Linux中 MySQL 授权远程连接 参考地址:https://www.centos.bz/2018/10/linux%e4%b8%ad-mysql-%e6%8e%88%e6%9d%83%e8%bf ...
- hadoop namenode启动失败
hadoop version=3.1.2 生产环境中,一台namenode节点突然挂掉了,,重新启动失败,日志如下: Info=-64%3A1391355681%3A1545175191847%3AC ...
- meshing-圆锥网格划分
原视频下载地址: https://pan.baidu.com/s/1boSjGXh 密码: 9zis