N

@nm

Aggressive Cows Problem

C++
3 years ago
// https://bit.ly/3LPbT8q (problem statement) #include <iostream> int main() { std::cout << "Hello world!" << std::endl; return 0; }

Painter’s Partition Problem

C++
3 years ago
// https://bit.ly/3SKh5gh (problem statement) #include <iostream> int main() { std::cout << "Hello world!" << std::endl; return 0; }

Book Allocation Problem

C++
3 years ago
// https://bit.ly/3SnwjrD (problem statement) #include <iostream> int main() { std::cout << "Hello world!" << std::endl; return 0; }

Search in Rotated Sorted Array

C++
3 years ago
#include <iostream> #include <vector> using namespace std; int binarySearch(vector<int>& nums, int s, int e, int target){ int start = s; int end = e; int mid = start + (end-start)/2;

Sqrt(x) with decimal precision

C++
3 years ago
#include <iostream> using namespace std; int findSqrtInt(int x) { int s = 0; int e = x; long long int mid = s + (e-s)/2; int ans = -1; while(s <= e){

Sorting Array using Stack

Java
3 years ago
import java.util.*; class Main { public static Stack<Integer> sortStack(Stack<Integer> input) { Stack<Integer> tempStack = new Stack<Integer>(); while (!input.isEmpty()) { int temp = input.pop(); while (!tempStack.isEmpty() && tempStack.peek() > temp) { input.push(tempStack.pop());

Swap Alternate elements in Array

C++
3 years ago
#include <iostream> using namespace std; void printArray(int arr[], int size){ cout << "Printing Array --> " << endl; for(int i=0; i<10; i++){ cout << arr[i] << " "; } cout << endl << endl; }

Sort 0 1 Array

C++
3 years ago
#include <iostream> using namespace std; void printArray(int arr[], int n){ cout << "----- Printing Array -----" << endl; for(int i=0; i<n; i++){ cout << arr[i] << " "; } cout << endl << endl; }

Reverse Array

C++
3 years ago
#include <iostream> #include <limits.h> using namespace std; void reverseArray(int arr[], int size){ int start = 0; int end = size-1; while(start <= end){ swap(arr[start], arr[end]);

Reverse Integer

C++
3 years ago
#include <iostream> #include <limits.h> using namespace std; int main() { cout << "Enter an Integer : "; int n; cin >> n; cout << endl;

Binary to Decimal Conversion

C++
3 years ago
#include <iostream> #include <math.h> using namespace std; int main() { cout << "Enter Binary Number : " ; int n; cin >> n; cout << endl;

Decimal to Binary Conversion

C++
3 years ago
#include <iostream> #include <math.h> using namespace std; int main() { cout << "Enter Decimal Number : " ; int n; cin >> n; cout << endl;

Pattern20 (Counting Number with Stars (Dabaang Pattern))

C++
3 years ago
#include <iostream> using namespace std; int main() { cout << "Enter a number : "; int n; cin >> n; cout << endl; int row = 1;

Pattern19 (Counting Number Equilateral Triangle)

C++
3 years ago
#include <iostream> using namespace std; int main() { cout << "Enter a number : "; int n; cin >> n; cout << endl; int row = 1;

Pattern18 (Counting Number Triangle With Spaces 1)

C++
3 years ago
#include <iostream> using namespace std; int main() { cout << "Enter Row Input : " ; int n; cin >> n; cout << endl; int row = 1;

Pattern17 (Counting Number Triangle With Spaces)

C++
3 years ago
#include <iostream> using namespace std; int main() { cout << "Enter Row Input : " ; int n; cin >> n; cout << endl; int row = 1;

Pattern16 (Number Triangle With Spaces 1)

C++
3 years ago
#include <iostream> using namespace std; int main() { cout << "Enter Row Input : " ; int n; cin >> n; cout << endl; int row = 1;

Pattern15 (Number Triangle With Spaces)

C++
3 years ago
#include <iostream> using namespace std; int main() { cout << "Enter Row Input : " ; int n; cin >> n; cout << endl; int row = 1;

Pattern14 (Star Triangle With Spaces)

C++
3 years ago
#include <iostream> using namespace std; int main() { cout << "Enter Row Input : " ; int n; cin >> n; cout << endl; int row = 1;

Pattern13 (Alphabets Triangle Reverse)

C++
3 years ago
#include <iostream> using namespace std; int main() { cout << "Enter Row Input : " ; int n; cin >> n; cout << endl; int row = 1;