learner_321's blog

By learner_321, history, 6 years ago, In English

Can anyone give example of file upload question, i.e in which we have to make frontend and backend based on the technology given in the question .This type of questions are asked some of the hiring challange on hackerearth. Can anyone explain or give some example of one of their submission and how they did it.

PS — Sorry for bad english.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By learner_321, history, 6 years ago, In English

You are given n poins in 2 dimesnsion.you need to find out minimum area of rectangle with atleast k points ?

1<=n<=200 0<=x<=40000 0<=y<=40000 1<=k<=n

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By learner_321, history, 6 years ago, In English

I understand the algorithm correctly . but can any one explain the logic / intuition behind this algorithm. like why this is working?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By learner_321, history, 6 years ago, In English

You are given to Strings , in one String you can swap any adjacent character , also you can swap first and last character . Find the minimum number of swaps required to make two String similar.

Sample Ip —

S1- aab S2- baa

Op — 1

You can swap first and last character of S2 , so ans will be 1.

How to solve this ?

Constraints were 1<=|S1|, |S2| <= 2000.

Full text and comments »

  • Vote: I like it
  • +50
  • Vote: I do not like it

By learner_321, history, 6 years ago, In English

Can we apply extend Extended Euclidean algorithm for negative numbers?

Like for 3*x-4*y=1 output will be x=3 , y=2 .

Full text and comments »

  • Vote: I like it
  • -6
  • Vote: I do not like it

By learner_321, history, 6 years ago, In English

You have been two integers n and m where n is the size of the array and m is the number of the edges. The next line contains an array of size n and next m lines contains two integers x and y each which represents that there exists a bidirectional edge between x and y. We have to output the number of permutations of the array which are lucky. A permutation is said to be lucky if for every Vi in the array there exists an edge between Vi and Vi+1.

I/p: 3 2 1 2 3

1 2

2 3

o/p:

2(1-2-3 and 3-2-1)

Full text and comments »

  • Vote: I like it
  • -5
  • Vote: I do not like it

By learner_321, history, 6 years ago, In English

Given a binary tree,where each node has value given x, (x>=0).

you need to find maximum sum of nodes's x value ,but you can not select two nodes in the answer such that one node is parent (only immediate),and other is child.

like if 1 is root , and its left child is 2 and right child is 3 ,then you can not include 1 and 2, or 1 and 3 in the answer,but you can include 2-3.

find maximum possible sum...

Number of nodes<= (1e6)

Full text and comments »

  • Vote: I like it
  • +2
  • Vote: I do not like it