上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 37 下一页
摘要: Given a text file file.txt that contains list of phone numbers (one per line), write a one liner bash script to print all valid phone numbers. You may 阅读全文
posted @ 2018-01-05 22:55 immjc 阅读(165) 评论(0) 推荐(0) 编辑
摘要: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文
posted @ 2018-01-05 16:27 immjc 阅读(89) 评论(0) 推荐(0) 编辑
摘要: Description: Count the number of prime numbers less than a non-negative number, n. 使用sieve of Eratosthenes方法对质数进行筛选。 题目要求就是写出这个算法。 原理是:给出要筛数值的范围n,找出出以 阅读全文
posted @ 2018-01-05 14:58 immjc 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan 阅读全文
posted @ 2018-01-04 23:08 immjc 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexi 阅读全文
posted @ 2018-01-04 20:13 immjc 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 函数指针 函数指针指向的是函数而非对象,和其他指针一样,函数指针指向某种特定类型。 函数的类型由它的返回值类型和形参类型共同决定,与函数名无关。 pf指向一个函数,该函数的参数是两个const string的引用,返回值是bool类型,*pf两边的括号必不可少 使用函数指针 当我们把函数名作为一个值 阅读全文
posted @ 2018-01-04 14:29 immjc 阅读(294) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an inte 阅读全文
posted @ 2018-01-04 12:47 immjc 阅读(193) 评论(0) 推荐(0) 编辑
摘要: You are given a license key represented as a string S which consists only alphanumeric character and dashes. The string is separated into N+1 groups b 阅读全文
posted @ 2018-01-03 22:10 immjc 阅读(217) 评论(0) 推荐(0) 编辑
摘要: In a given integer array nums, there is always exactly one largest element. Find whether the largest element in the array is at least twice as much as 阅读全文
posted @ 2018-01-03 20:38 immjc 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 三种函数相关的语言特性:默认实参、内联函数、constexpr函数 默认实参 某些函数有这样一些形参,在函数的很多次调用中它们都被赋予一个相同的值,此时,我们把这个反复出现的值称为函数的默认实参。调用含有默认实参的函数时,可以包含该实参,也可以忽略该实参。 其中我们为每个形参都提供了默认实参,默认实 阅读全文
posted @ 2018-01-03 14:48 immjc 阅读(298) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 37 下一页