Skip to content

Instantly share code, notes, and snippets.

View roniemicro's full-sized avatar

Roni Saha roniemicro

  • eMicroGraph Business Solutions & Right Brain Solution
  • Bangladesh
View GitHub Profile
@roniemicro
roniemicro / blancedBracket.php
Last active December 16, 2015 02:19
some Simple Implementation of isBalanced function
<?php
function isBalanced($string)
{
$str = preg_replace('([^\(\)])', '', $string);
if($str == ""){
return TRUE;
}
@roniemicro
roniemicro / palindrome.php
Last active December 16, 2015 11:28
Simple Palindrome Finder
<?php
function pushPalindrome(&$found, $word){
$str = strtolower($word);
if(strrev($str) === $str){
$found[strtolower($str)] = $word;
}
}
@roniemicro
roniemicro / 3n_plus_one.js
Last active December 16, 2015 18:58
3n+1 assignment sollution
function isOdd(n){
return (n & 1);
}
function getStepCount(n, c){
var count = c | 0;
count++;
if(n < 1){
return 0;
@roniemicro
roniemicro / 3n.php
Created May 1, 2013 12:43
3n+1 Php Implementation
<?php
ini_set('xdebug.max_nesting_level', 10000000);
function isOdd($n)
{
return ($n & 1);
}
function getStepCount($number, &$cache)
{
$count = 1;
@roniemicro
roniemicro / input.txt
Created May 7, 2013 08:23
Palindrome, Palindrome Input set
UAJZYO8KBWPUPGIOOFC
LEPFWFCMB
XHDV1V6TOBW4
YHIE1OU5ZUO13IHY
HJIRERR4NCFUSYZ4QC4G
6XSYSJ7O66O7JSYSX6
LJC52ILQD5DF3X3ISC7
C2ZVXULFIU
PHJTSZLZSTJHP
34R
@roniemicro
roniemicro / output.txt
Last active December 17, 2015 01:49
Output for sample input.txt data with palindrome probllem
UAJZYO8KBWPUPGIOOFC -- is not a palindrome.
LEPFWFCMB -- is not a palindrome.
XHDV1V6TOBW4 -- is not a palindrome.
YHIE1OU5ZUO13IHY -- is a mirrored string.
HJIRERR4NCFUSYZ4QC4G -- is not a palindrome.
@roniemicro
roniemicro / factin.txt
Created May 22, 2013 02:02
Sample Input for just fact to range 10000
5764
9256
5481
1149
6616
405
4451
1839
2691
9936
@roniemicro
roniemicro / factin1000.txt
Created May 22, 2013 02:04
Sample Input for just fact to range 1000
709
230
709
989
304
59
318
914
932
622
@roniemicro
roniemicro / factin100.txt
Created May 22, 2013 02:09
Sample Input for just fact to range 100
37
41
49
51
38
87
23
54
74
78
@roniemicro
roniemicro / factout.txt
Created May 22, 2013 02:27
Sample Output for just fact to range 10000
5764 -> 8
9256 -> 6
5481 -> 2
1149 -> 4
6616 -> 8
405 -> 6
4451 -> 6
1839 -> 4
2691 -> 2
9936 -> 2