## acharyashailendra1

BAN USER- 0of 0 votes

AnswerThere are cards and each card has an identity. e.g. HC1 has ID 1, this ID also represents the cost of the card. Your sister already have some cards and you want to gift her cards which she do not have already. Program is to return the max number of cards you can buy for her.

- acharyashailendra1 in India

Constraint : You have amount d, and want to buy as many distinct card as you can.

e.g. Sister Cards = [2, 3, 5], D : 7 Card you buy : 1, 4

Output : 2| Report Duplicate | Flag | PURGE

SDE-2 - 0of 0 votes

AnswersYou have been given a special and normal status of alphabets.

- acharyashailendra1 in India

e.g. “01111001111111111011111111” represents “abcdefghijklmnopqrstuvwxyz”. Here 0 represents normal character and 1 represents special character.

Given an Input String S and a number k, find the maximum continuous sub array with maximum k number of number elements. There is no constraint on special character.

e.g.

S = “giraffe”, K = 1, “011110011111111110111111”

Output : 3

How ?

normal characters : a, g, f

one of the possible solution : gir (as this has only one normal character)| Report Duplicate | Flag | PURGE

SDE-2 - 0of 0 votes

AnswerGiven a binary String which represents the target state. Minimum number of flips needed to convert a same size Binary String (with all 0’s) to target state. A flip also causes all the right bits to be flipped.

- acharyashailendra1 in India

e.g.

Input : 00101 (Represents Target)

Output : 3

Explanation :

00000 -> 00111 -> 00100 -> 00101| Report Duplicate | Flag | PURGE

SDE-2 - 0of 0 votes

Answeryou are given string of digits, a value x and N. you have to divide that string in ((i-1)*x+1,min(i*x)) parts.

- acharyashailendra1 in India

for example a String is ="1234567891" and x=5,N=10 then

there will be 2 partition of string since x=5

[12345] end [67891]

you have to find kth min number from these combinations. for example k=3 then ans should be 17

combination will happen like every digit from 1st partition will concanate with other partition digits

so if there were three partition for string 123456789 then it could be like

[123][456][789]

and if k=3 then ans would be 149| Report Duplicate | Flag | PURGE

- 0of 0 votes

Answersrepeat string n^n times without using extra space

- acharyashailendra1 in India| Report Duplicate | Flag | PURGE

Myntra - 1of 1 vote

AnswerA dictionary is combination of characters from a-z. let's say a=1,b=2.. and so on z=26. you are given n and k. you have to find sum of length k from given combination.

- acharyashailendra1 in India

for example n=51 and k=3 then your answer should be =axz

as there can be many combination for given sum so it is suggested to print those string which comes first in dictonary| Report Duplicate | Flag | PURGE

LendingKart SDE-2 Data Structures - 1of 1 vote

Answersbeautiful numbers are those numbers which contains digit only 4 and 5 also they are palindrome.length of number can't be odd. for example

- acharyashailendra1 in India

44,55,4554 are beautiful numbers where as 38, 444 are not.

your task is to find nth number in this series. let's say if n=4 then output should be 4554. for n=1 output will be 44 always.| Report Duplicate | Flag | PURGE

LendingKart SDE-2 Data Structures

Hi 123ayanjit,

for example string str = "hello" and n=3 then we have to print hello n^n times which means 27 times. but please also consider that n is very large so we can't store it.

Hi 123ayanjit,

for example string str = "hello" and n=3 then we have to print hello n^n times which means 27 times. but please also consider that n is very large so we can't store it.

Rep**KimRPierce**, Employee at Achieve InternetI am a customer service-oriented Travel Agent in Travel and Tourism industries. I strongly believe that the skills and abilities ...

**CareerCup**is the world's biggest and best source for software engineering interview preparation. See all our resources.

Open Chat in New Window

is there any other way to solve this problem? is it possible using tree?

- acharyashailendra1 November 08, 2019