Tony's Log

Algorithms, Distributed System, Machine Learning

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2015年4月30日

摘要: My first reaction was, total No. of strings - no. of palindromic strings. But looks like counting all palindromic strings is not that easy.. So it has... 阅读全文
posted @ 2015-04-30 15:30 Tonix 阅读(243) 评论(0) 推荐(0)

摘要: Please note input constraints. String length will not exceed 100, which means, we can use relatively naive representation\calculation for anagrams: so... 阅读全文
posted @ 2015-04-30 13:29 Tonix 阅读(475) 评论(0) 推荐(0)

摘要: Sieve of Eratosthenesclass Solution {public: int countPrimes(int n) { if(n rec(n + 1, false); int bound = floor(sqrt(n)); i... 阅读全文
posted @ 2015-04-30 01:04 Tonix 阅读(140) 评论(0) 推荐(0)