Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geekweek #609

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Geeks DSA.pdf
Binary file not shown.
3 changes: 3 additions & 0 deletions POORNIMA
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
###
I am Poornima Raghuwanshi
Student of VIT Bhopal from CSE Core 2nd year student
Binary file added geekweek day2.pdf
Binary file not shown.
22 changes: 22 additions & 0 deletions poornima835/HackerRank1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
##REVERSE AN ARRAY

#include <bits/stdc++.h>


using namespace std;
int main()
{
int numElements;
cin >> numElements;
int arr[numElements];
for (int i = 0; i < numElements; i++){
cin >> arr[i];
}

for (int i = numElements - 1; i >= 0; i--){


cout << arr[i] << " ";
}
return 0;
}
53 changes: 53 additions & 0 deletions poornima835/HackerRank2
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
##Dynamic Array

import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

int n = sc.nextInt();
int q = sc.nextInt();
int inc=0,inb=0;
int last = 0,x;
int a[][] = new int[q][3];
int b[] = new int[100000];
int c[] = new int[100000];

for(int i = 0; i<q ; i++)
{
for(int j=0;j<3;j++)
a[i][j] = sc.nextInt();

x = ((a[i][1]^last)%n); //sequence s1 or s0
if(a[i][0] == 1) // query 1 or 0
{
if(x == 0)
b[inb++] = a[i][2];
else
c[inc++] = a[i][2];
}
else{

if(x == 0)
last = b[a[i][2]%(inb)];
else
last = c[a[i][2]%(inc)];

System.out.println(last);


}


}


}
}
52 changes: 52 additions & 0 deletions poornima835/HackerRank3
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
##2D ARRAY

import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Solution {

private static final Scanner scanner = new Scanner(System.in);

public static void main(String[] args) {
int[][] arr = new int[6][6];

for (int i = 0; i < 6; i++) {
String[] arrRowItems = scanner.nextLine().split(" ");
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");

for (int j = 0; j < 6; j++) {
int arrItem = Integer.parseInt(arrRowItems[j]);
arr[i][j] = arrItem;
}
}

int max_sum = 0;
int temp_sum;
for(int i = 0; i < 4; i++) {
for(int j = 0; j < 4; j++) {
temp_sum = 0;
// top row
temp_sum += arr[i][j];
temp_sum += arr[i][j+1];
temp_sum += arr[i][j+2];
//middle
temp_sum += arr[i+1][j+1];
//bottom row
temp_sum += arr[i+2][j];
temp_sum += arr[i+2][j+1];
temp_sum += arr[i+2][j+2];

//if first hourglass, set as max
if(temp_sum > max_sum || i == 0 && j == 0)
max_sum = temp_sum;
}
}
System.out.println(max_sum);
scanner.close();
}
}
4 changes: 4 additions & 0 deletions poornima835/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
##About me
Name: POORNIMA RAGHUWANSHI
Registration number: 19BCE10444
I'm CSE Core 2nd year student. I am a learner. I like new technologies and want to learn more
78 changes: 78 additions & 0 deletions poornima835/SnoopDog
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
###MUSICAL APPLICATION USING C++



#include<bits/stdc++.h>
#include <windows.h>
using namespace std;

int main()

{

unordered_map<string, int> notes = {
{"a", 440},
{"a#", 466},
{"b", 493},
{"c", 523},
{"c#", 554},
{"d", 587},
{"d#", 622},
{"e", 659},
{"f", 698},
{"f#", 739},
{"g", 783},
{"g#", 830},
{"a5", 880},
};
string note;
long long int duration;

vector<pair<string, int>> octave = {

{"a", 400},
{"b", 400},
{"c", 400},
{"d", 400},
{"e", 400},
{"f", 400},
{"g", 400},
{"a5", 400},
};

vector<pair<string, int>> SnoopDogg =
{

{"d#", 600},
{"a5", 600},
{"a5", 300},
{"g#", 300},
{"a5", 600},
{"g#", 300},
{"f#", 300},
{"g#", 600},
{"g#", 300},
{"f#", 300},
{"d#", 300},
{"f#", 300},
};


while (true)
{
cout<<"Input note: ";
cin >> note;
if(note == "x")
break;
Beep(notes[note], 750);


}
for(int k=0; k<2; k++){
for(auto i: SnoopDogg)
{
Beep(notes[i.first], i.second);
}}
return 0;

}
Loading