0% found this document useful (0 votes)
11 views5 pages

Sayandas 3108

I am very briliant student

Uploaded by

Shshaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views5 pages

Sayandas 3108

I am very briliant student

Uploaded by

Shshaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

HackerEarth

Assessment report

Adobe Coding Interview

G Candidate alias: Guiltless Blacephalon

TOTAL SCORE

 175/300 Top 6%
TEST
BENCHMARK

RANK* ATTEMPTED
13/207 3 of 3 questions

Test time analysis

TEST START TIME TEST END TIME TEST DURATION

Jul 08 2024, 07:49:34 PM IST (Asia/Kolkata) Jul 08 2024, 09:49:34 PM IST (Asia/Kolkata) 1 hr 59 min 59 sec of 2 hr used.

Skill-wise performance

backtracking

math
Skills (4)

dynamic programming

algorithms

0 10 20 30 40 50 60 70 80 90 100

Score (%)

Skill score for the candidate Average score of a skill within the test

Detailed submission report

Programming Questions Questions attempted: 3 of 3


Programming Questions Questions attempted: 3 of 3

# Questions (3) No. of attempts Result Score (175/300)


Se
 E

1 Stairs JUMP [Adobe] 1  100/100


Hacker is a newborn baby, his foot can jump up to 2 stairs. Hacker wants to climb the terrace and n Secti
number of stairs. How many distinct ways to climb to the terrace.  Med
Input format > The first line contains N is denoting the number of stairs.
Output format > Print number of distinct way to climb the terrace
Constraints 1<=N<=45
Secti
 Hard
Score Result Time Time Complexity Beta Space Complexity Beta Memory Language Submitted on
100 BEST  0.50158 sec O(n) O(n) 90440 KB Java 17 Jul 08 2024, 07:59:11 PM IST (Asia/Kolkata)

 Source code Plaintext Link

1 import java.io.BufferedReader;
2 import java.io.InputStreamReader;
3 import java.util.*;
4 class TestClass {
5 public static void main(String args[] ) throws Exception {
6 //BufferedReader
7 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8 int n = Integer.parseInt(br.readLine());
9
10 int dp[]=new int[n+1];
11 dp[0]=1;
12 dp[1]=1;
13
14 for(int i=2;i<=n;i++)
15 dp[i]+=dp[i-1]+dp[i-2];
16
17 System.out.println(dp[n]);
18 }
19 }
20

1 Anagrams Game [Adobe] 4  75/100


Hacker is playing a game which is called Anagrams game. In this game, there are two strings S and P. P is
non empty string. In this game, there is one challenge. You have to find all the start indices of p's
anagrams in s.
Note: Output should be sorted
Input format
The first line contains two strings, S and P.
Output format
Print all the start indices of p's anagrams in s.
Constraints
1<=length of S and P<=20100

Score Result Time Time Complexity Beta Space Complexity Beta Memory Language Submitted on
Sco e esu t e e Co p e ty eta Space Co p e ty eta e o y a guage Sub tted o
75 BEST  0.56661 sec O(n) O(1) 94096 KB Java 17 Jul 08 2024, 08:24:25 PM IST (Asia/Kolkata)

 Source code Plaintext Link

1 import java.io.BufferedReader;
2 import java.io.InputStreamReader;
3 import java.util.*;
4 class TestClass {
5 public static void main(String args[] ) throws Exception {
6 //BufferedReader
7 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8 String name[] = br.readLine().split(" ");
9
10 int alph[]=new int[27],c=0;
11
12 for(char ca:name[1].toCharArray())
13 if(++alph[ca-'a']==1)
14 c++;
15
16 int head=0,tail=0;
17
18 List<Integer> l=new ArrayList<>();
19
20 while(tail<name[0].length())
21 {
22 int pos=name[0].charAt(tail)-'a';
23
24 if(alph[pos]==0)
25 c++;
26
27 alph[pos]--;
28
29 if(alph[pos]==0)
30 c--;
31
32 if((tail-head)==name[1].length())
33 {
34 pos=name[0].charAt(head)-'a';
35
36 if(alph[pos]==0)
37 c++;
38 alph[pos]++;
39
40 if(alph[pos]==0)
41 c--;
42 head++;
43 }
44
45 if((tail-head+1)==name[1].length() && c==0)
46 l.add(head);
47
48 tail++;
49 }
50
i l (l)
51 System.out.println(l);
52 }
53 }
54

1 Hacker Confusing [Adobe] 1  0/100


Hacker wants to play a game with numbers. The game is simple. If a digit rotates 180 degrees to form
new digit, then it's a valid number else it's invalid. Suppose 0,1,6 are rotated 180 degrees, they became
0,1,9. So these are valid numbers else 2,3 are rotated 180 degrees, they become an invalid number.
Given a positive integer N, return the number of valid numbers between 1 and N inclusive.
Input format > The first line contains a positive integer N.
Output format > Print the number of valid numbers between 1 and N inclusive.
Constraints 1<=N<=10^9

Score Result Time Time Complexity Beta Space Complexity Beta Memory Language Submitted on
0  0.71928 sec Unavailable Unavailable 92132 KB Java 17 Jul 08 2024, 09:47:34 PM IST (Asia/Kolkata)

 Source code Plaintext Link

1 import java.io.BufferedReader;
2 import java.io.InputStreamReader;
3 import java.util.*;
4 class TestClass {
5 public static void main(String args[] ) throws Exception {
6 //BufferedReader
7 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8 long n = Long.parseLong(br.readLine());
9
10 long a=n,c=0l;
11
12 long ans=0l;
13
14 while(a!=0)
15 {
16 c++;
17 a=a/10;
18 }
19
20 for(int i=1;i<=c;i++)
21 ans= ans + (long)(4l*Math.pow(5,i-1));
22
23 long count=0l,temp=0l;
24 while(n!=0)
25 {
26 count++;
27
28 if(help2(n%10)==true)
29 temp=0l;
30
31 long val=help(n%10);
32 temp+= (long)(val*Math.pow(5,count-1));
33 System.out.println(temp);
34 n=n/10;
35 }
36
37 ans=ans-1;
38
39 System.out.println(ans);
40 }
41
42 public static long help(long val)
43 {
44 if(val<1l)
45 return 4l;
46 else if(val<6l)
47 return 3l;
48 else if(val<8l)
49 return 2l;
50 else if(val<9l)
51 return 1l;
52
53 return 0;
54 }
55
56 public static boolean help2(long val)
57 {
58 if(val==0 || val==1 || val==6 || val==8 || val==9)
59 return false;
60
61 return true;
62 }
63 }
64

* - This information is based on the data that is available untill Jul 08 2024, 10:05:03 PM IST (Asia/Kolkata). Your rank may be updated once all the candidates have successfully completed their tests.
Thank you for taking this test. All the best for further processes.
Note: This report is generated by HackerEarth. To know more, visit www.hackerearth.com

You might also like