Skip to content

Instantly share code, notes, and snippets.

View lazycipher's full-sized avatar
🛡️
Stealth Mode

Himanshu Singh lazycipher

🛡️
Stealth Mode
View GitHub Profile
@lazycipher
lazycipher / varSizedArrayHackerrank.cpp
Created May 5, 2019 05:32
Variable Sized Array [HackerRank Practice]
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, q, indexA, indexI;
@lazycipher
lazycipher / StringStream.cpp
Created May 5, 2019 10:39
StringStream HackerRank Practice C++
#include <sstream>
#include <vector>
#include <iostream>
using namespace std;
vector<int> parseInts(string str) {
stringstream s(str);
vector<int> arr;
int a;
char ch;
@lazycipher
lazycipher / VectorSort.cpp
Created May 5, 2019 10:44
Vector-Sort HackerRank Practice
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
vector<int> ins;
''' In the first line integer n - the number of test cases (equal to about 1000).
Then n test cases follow. Each test case starts with the number of lines which is followed by their content. '''
n = int(input())
db = []
for i in range(n):
lines = int(input())
temp = []
for j in range(lines):
@lazycipher
lazycipher / classHackerRank.cpp
Created May 6, 2019 22:06
Class Problem HackerRank in C++
#include <iostream>
#include <sstream>
using namespace std;
class Student{
private:
int age, standard;
string first_name, last_name;
public:
@lazycipher
lazycipher / BoxItHackerRank.cpp
Created May 7, 2019 14:22
HackerRank Problem Box It! In C++
#include<bits/stdc++.h>
using namespace std;
class Box{
private:
int l, b, h;
public:
Box(){
this->l = this->b = this->h = 0;
@lazycipher
lazycipher / VectorErase.cpp
Created May 7, 2019 14:39
HackerRank Vector Erase Problem in C++
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
vector<int> ins;
@lazycipher
lazycipher / LowerBoundSTL.cpp
Created May 7, 2019 15:39
HackerRank Problem Lower Bound-STL
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n,q;
@lazycipher
lazycipher / SetsSTLHackerRank.cpp
Created May 7, 2019 15:50
HackerRank C++ Sets-STL Problem
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main() {
@lazycipher
lazycipher / Maps-STLHackerRank.cpp
Created May 8, 2019 13:26
Maps STL HackerRank Problem
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <set>
#include <map>
#include <algorithm>
#include<string>
using namespace std;