Arun Kumar Gupta
BAN USERA number is Fibonacci if and only if one or both of (5*n2 + 4) or (5*n2 – 4) is a perfect square.
- Arun Kumar Gupta May 22, 2016This is the perfect solution, We can modify a bit if we get a expression we can append () in Expression Explicitly though it's not needed but still.
so if you get a+(e+(b*c)) ==> (a+(e+(b*c)))
I will take stack as horizontal.
Stack ==> ( a ( e ( b top
when first ")" encountered value should be on the top. yes it is. so remove up to first "(".
Stack ==>
( a ( e
top
now encountered new ")"
if you don't encounter any "value" on the top of Stack then there is a redundant Brackets.
like
((a))
( ( a
after first encounter
left Stack ==> (
second encounter ")"
no value on the top. Error got it.
stackoverflow.com/questions/198431/how-do-you-compare-two-version-strings-in-java
- Arun Kumar Gupta April 04, 2014it's not correct see for test case
2,3
4,5
result
Maximum number(=1) of species live between: 2,5 years of age
it should be
it should be either 2,3 or 4,5
Nice !!! :) it's awesome ..
- Arun Kumar Gupta June 09, 2013Nice
here is the best solution
arungupta1.blogspot.in/2012/09/how-many-ip-address.html
arungupta1.blogspot.in/
see the solution here
nice explanation !!!!!!
- Arun Kumar Gupta September 09, 2012luv is correct leaving one node out of all make a graph disconnected
- Arun Kumar Gupta September 09, 2012we can do like that 64! / 8!*8!*48!
- Arun Kumar Gupta September 09, 2012Message in TCP always appear in the order sent.
yes message in tcp always appears in order because they are ordered by the ip layer
arungupta1.blogspot.in/2012/09/print-nn-matrix-in-spiral-order.html
- Arun Kumar Gupta September 08, 2012arungupta1.blogspot.in/2012/09/print-nn-matrix-in-spiral-order.html
- Arun Kumar Gupta September 08, 2012Mine sol solves it in O(n)
- Arun Kumar Gupta August 28, 2012this is very simple code takes only O(n).
import java.util.*;
import java.lang.*;
public class InterleavingCharecter
{
public static void main (String [] args)
{
String input1 = "abc";
String input2= "xyz";
String input3 = "abxcyz";
int len = input3.length();
int lenb = input2.length();
int lena = input1.length();
//System.out.println(len);
char a[] = input1.toCharArray();
char b []= input2.toCharArray();
char c []= input3.toCharArray();
System.out.println(c[0]);
int aa =0 , bb = 0 , cc = 0 ;
for(int i = 0 ;i < len ; i++ )
{
if(c[cc] == a [aa])
{
System.out.println(c[cc]+":"+a[aa]);
++cc;
++aa;
if(aa >= lena)
--aa;
}
else if(c[cc] == b [bb])
{
System.out.println(c[cc]+":"+b[bb]);
++cc;
++bb;
if(bb >= lenb)
--bb;
}
else
{
System.out.println("Not Interleaved Correctly");
System.exit(0) ;
}
}
//System.out.println(cc);
if(cc < len)
System.out.println("Interleaving is correct but something is miising ");
}
}
- Arun Kumar Gupta August 27, 2012fuck off!!!!
- Arun Kumar Gupta August 27, 2012very nice !!!! brother
- Arun Kumar Gupta August 27, 2012nice !!!!!
- Arun Kumar Gupta August 24, 2012Hey i am thinking it should be 2 and tables should be developed like this that
studentid address second table id and courses
it's ok !!! to use linked list but it's space and run time complexity will increase tremendously
- Arun Kumar Gupta July 24, 2012just use the tracert method to find out the external ip address
- Arun Kumar Gupta July 22, 2012tcpdump
- Arun Kumar Gupta July 22, 2012Full ...bewkoof itna bhi ni pata
- Arun Kumar Gupta July 22, 2012Actually what happens that
when you enter the ulr first work is to find out the ip address of that which will be done by DNS naming ... then find the ip address
no this is not a data base question
- Arun Kumar Gupta July 22, 2012Complete Solution is there
arungupta1.blogspot.in/2012/07/one-more-logic-reverse-string.html
please go through the link
awesome
- Arun Kumar Gupta July 21, 2012Best Answer Brother
- Arun Kumar Gupta July 21, 2012I have developed this code to the
import java.util.*;
import java.lang.Math.*;
public class Triangle
{
public static void main (String [] args)
{
Scanner cs = new Scanner(System.in);
double ax = cs.nextInt();
double ay = cs.nextInt();
double bx = cs.nextInt();
double by = cs.nextInt();
double cx = cs.nextInt();
double cy = cs.nextInt();
double dx = cs.nextInt();
double dy = cs.nextInt();
//double arr[] = new flaot[6];
double ab = dist(ax,ay,bx,by);
double bc = dist(bx,by,cx,cy);
double ac = dist(ax,ay,cx,cy);
double ad = dist(ax,ay,dx,dy);
double bd = dist(dx,dy,bx,by);
double cd = dist(cx,cy,dx,dy);
if(((ad < ab) && (ad < ac)) && ((bd < ab) && (bd < bc)) && ((cd < ac) && (cd < bc)) )
System.out.println("Point it inside the triangle ");
else
System.out.println("Point is out side of the triangle");
ontheline(ax,ay,bx,by , dx, dy);
ontheline(ax,ay,cx,cy , dx, dy);
ontheline(bx,by,cx,cy , dx, dy);
if((ax == dx ) && (ay == dy ))
System.out.println("\n Point d is in the Point"+ax+":"+ay);
if((bx == dx ) && (by == dy ))
System.out.println("\n Point d is in the Point"+bx+":"+by);
if((cx == dx ) && (cy == dy ))
System.out.println("\n Point d is in the Point"+cx+":"+cy);
}
static void ontheline(double x1 , double y1 , double x2 , double y2 , double x3, double y3)
{
double a = ((y2-y1) / (x2-x1));
double b = (y1 - (a*x1));
if(b == (y3 - (a*x3)))
System.out.println("on the line in points "+x1+ ":"+y1+"::"+x2+ ":"+y2);
}
static double dist(double x1 , double y1 , double x2 , double y2 )
{
double distance=Math.sqrt(((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)));
return distance;
}
}
this code is CC to Arun Kumar Gupta
- Arun Kumar Gupta July 21, 2012it's too simple just check the distance from the each point of triangle to that point ...
like let A(a,b) B(c,d) C(e,f) these are the points of the triangle .... and D(p ,q) are the point to be found then do nothing just find the distance between each point like AB , AC, BC if it greater than any distance means it's out of the triangle .... i will post code here thanx
Repjacobghester2, Accountant at ASAPInfosystemsPvtLtd
I'm an artist at heart. I went from print design to web development and lots of server administration professionally ...
- Arun Kumar Gupta August 17, 2016