-
Notifications
You must be signed in to change notification settings - Fork 0
/
ques.js
82 lines (62 loc) · 1.44 KB
/
ques.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Given two strings S1 and S2. The task is to find if a string 'S2’'
// can be obtained by rotating another string
// 'S1’' by 2 places using Stack.
// Input 1= jackal
// Input 2 = ckalja
// let final="";
// for(let i=0; i<res.length; i++){
// if(res[i] === m[i]){
// final = (1)
// }else{
// final = (0)
// }
// }
// output : 1
// <----------Out Put : 1 Completed ----------------->
// n = 5
// a = [1,2,3,4,5]
// let res = []
// for(let i=0; i<a.length; i++){
// if(n*i == 5 ){
// res.push(a[i])
// }
// }
// console.log(res)
// a = [1,2,3,4,5]
// a.array.forEach(element => {
// console.log(a*2)
// });
// a = [1,2,3,4,5,6,7,8]
// res=[]
// for(let i=0; i < a.length; i++){
// if(a[i]%2 == 0){
// res.push(10)
// }
// }
// data = {
// {"name" : "magesh", "profession": "developer"}
// {"name" : "ram", "profession": "doctor"}
// {"name" : "rs", "profession": "doctor"}
// }
// function basic_fun(val){
// return val
// }
// aa = data.map((basic_fun)=>{
// value = val.name + "is a" + val.profession
// return val
// })
// console.log(aa)
// a = [1100, 140, 1500,2000,2016,2020,2040,3000]
// aa = a.reduce((a,b)=> a,b)
// console.log(aa)
// a = [10,13,14,14,10]
// let max=a[0];
// for(let i=0; i<a.length; i++){
// if(max < a[i]){
// max = a[i]
// }
// }
// let divisor = max
// let result = 0;
// while( result > max )
// console.log(max)